Skip to content

Commit

Permalink
feat: rename to runtrigger
Browse files Browse the repository at this point in the history
  • Loading branch information
runreal-warman committed Apr 4, 2024
1 parent 6bb7944 commit 625c510
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# triggerr
`triggerr` is a command-line tool for managing and creating Perforce triggers written in TypeScript and running on Deno.
# runtrigger
`runtrigger` is a command-line tool for managing and creating Perforce triggers written in TypeScript and running on Deno.

- Write and configure triggers in Typescript
- Manage triggers from simple CLI interface
Expand All @@ -9,7 +9,7 @@
⚠️ Currently alpha - use at your own risk. ⚠️

## Example
`triggerr init` to initialize an empty `triggerr` script:
`runtrigger init` to initialize an empty `runtrigger` script:

```ts
import { TriggerConfig, TriggerContext, TriggerFn } from './types.ts'
Expand Down Expand Up @@ -40,20 +40,20 @@ export const main: TriggerFn = async (args: string[], ctx: TriggerContext) => {
}
```

`triggerr add` to add the script to the Perforce configuration:
`runtrigger add` to add the script to the Perforce configuration:

```sh
┌───────┬─────────────────┬───────────────┬───────────────────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Index │ Name │ Type │ Path │ Command │
├───────┼─────────────────┼───────────────┼───────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 0 │ example-trigger │ change-commit │ //Engine/... │ triggerr exec file:///C:/P4/triggers/example-trigger.ts example-arg %user% %changelist% │
│ 0 │ example-trigger │ change-commit │ //Engine/... │ runtrigger exec file:///C:/P4/triggers/example-trigger.ts example-arg %user% %changelist% │
├───────┼─────────────────┼───────────────┼───────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ 1 │ example-trigger │ change-commit │ //Project/... │ triggerr exec file:///C:/P4/triggers/example-trigger.ts example-arg %user% %changelist% │
│ 1 │ example-trigger │ change-commit │ //Project/... │ runtrigger exec file:///C:/P4/triggers/example-trigger.ts example-arg %user% %changelist% │
└───────┴─────────────────┴───────────────┴───────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘

```

`triggerr exec` will now safely execute the scripts when the triggers fire, write the logs to a file, and capture any result or errors.
`runtrigger exec` will now safely execute the scripts when the triggers fire, write the logs to a file, and capture any result or errors.

See `/examples` for some additional example scripts.

Expand All @@ -62,34 +62,34 @@ Make sure you have [Deno installed](https://docs.deno.com/runtime/manual/getting

### From GitHub
```sh
deno install --name triggerr --force --allow-net --allow-read --allow-env --allow-run --allow-write --allow-sys https://raw.githubusercontent.com/runreal/triggerr/main/src/index.ts
deno install --name runtrigger --force --allow-net --allow-read --allow-env --allow-run --allow-write --allow-sys https://raw.githubusercontent.com/runreal/runtrigger/main/src/index.ts
```
### From Source
```sh
git clone https://github.com/runreal/triggerr
deno install --name triggerr --force --allow-net --allow-read --allow-env --allow-run --allow-write --allow-sys src/index.ts
git clone https://github.com/runreal/runtrigger
deno install --name runtrigger --force --allow-net --allow-read --allow-env --allow-run --allow-write --allow-sys src/index.ts
```

## Commands
### `list`
```
Usage: triggerr list
Usage: runtrigger list
Description:
list current triggers
```

### `init`
```
Usage: triggerr init
Usage: runtrigger init
Description:
initialize a new triggerr project
initialize a new runtrigger project
Options:
-p, --path <path> - Path to initialize (Default: "./triggers/")
```

### `add`
```
Usage: triggerr add <script>
Usage: runtrigger add <script>
Description:
add a trigger
Options:
Expand All @@ -99,7 +99,7 @@ Options:

### `update`
```
Usage: triggerr update <script>
Usage: runtrigger update <script>
Description:
update a trigger
Options:
Expand All @@ -109,14 +109,14 @@ Options:

### `rm`
```
Usage: triggerr rm <trigger-index>
Usage: runtrigger rm <trigger-index>
Description:
remove a trigger
```

### `exec`
```
Usage: triggerr exec <script> [args...]
Usage: runtrigger exec <script> [args...]
Description:
execute a trigger with optional arguments
```
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { renderTriggerTable } from './lib/utils.ts'
import { P4Trigger, TriggerConfig, TriggerContext, TriggerFn } from './lib/types.ts'

await new Command()
.name('triggerr')
.name('runtrigger')
.version(VERSION)
.description('the perforce trigger manager')
.command('list', 'list current triggers')
Expand All @@ -17,7 +17,7 @@ await new Command()
const triggers = p4.parseTriggersOutput(cmd.output)
renderTriggerTable(triggers)
})
.command('init', 'initialize a new triggerr project')
.command('init', 'initialize a new runtrigger project')
.option('-p, --path <path:file>', 'Path to initialize', { default: path.join(Deno.cwd(), 'triggers/') })
.action(async ({ path }) => {
// create the directory
Expand Down Expand Up @@ -47,7 +47,7 @@ await new Command()

let triggerCommand = ''
if (executable) {
triggerCommand = `triggerr exec ${script} ${config.args.join(' ')}`
triggerCommand = `runtrigger exec ${script} ${config.args.join(' ')}`
} else {
// We want to run this cli as the entry point
const cliPath = path.fromFileUrl(import.meta.url)
Expand Down Expand Up @@ -96,7 +96,7 @@ await new Command()

let triggerCommand = ''
if (executable) {
triggerCommand = `triggerr exec ${script} ${config.args.join(' ')}`
triggerCommand = `runtrigger exec ${script} ${config.args.join(' ')}`
} else {
// We want to run this cli as the entry point
const cliPath = path.fromFileUrl(import.meta.url)
Expand Down

0 comments on commit 625c510

Please sign in to comment.