-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db2fcb8
commit 84e352f
Showing
8 changed files
with
43 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,13 @@ | ||
import { runScript } from '@pact-toolbox/script'; | ||
import { logger } from '@pact-toolbox/utils'; | ||
import { defineCommand } from 'citty'; | ||
|
||
export const runCommand = defineCommand({ | ||
export const hintCommand = defineCommand({ | ||
meta: { | ||
name: 'run', | ||
description: 'Run a script with the toolbox runtime', | ||
name: 'hint', | ||
description: 'Give a hint about an exercise', | ||
}, | ||
args: { | ||
script: { | ||
type: 'positional', | ||
name: 'script', | ||
description: 'Script to run', | ||
required: true, | ||
}, | ||
start: { | ||
type: 'boolean', | ||
name: 'start', | ||
alias: 's', | ||
description: 'Start the network before running the script', | ||
required: false, | ||
default: true, | ||
}, | ||
network: { | ||
type: 'string', | ||
name: 'network', | ||
alias: 'n', | ||
description: 'Network to use', | ||
required: false, | ||
default: 'local', | ||
}, | ||
}, | ||
run: async ({ args }) => { | ||
const { script, network, start, ...rest } = args; | ||
logger.start(`Running script ${script} on network ${network}`); | ||
await runScript(script, { | ||
network, | ||
args: rest, | ||
scriptOptions: { | ||
autoStartNetwork: start, | ||
}, | ||
}); | ||
args: {}, | ||
run: async () => { | ||
logger.error(`Hint command is not implemented yet.`); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { logger } from '@pact-toolbox/utils'; | ||
import { defineCommand } from 'citty'; | ||
|
||
export const listCommand = defineCommand({ | ||
meta: { | ||
name: 'list', | ||
description: 'List all exercises', | ||
}, | ||
args: {}, | ||
run: async () => { | ||
logger.error(`List command is not implemented yet.`); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,13 @@ | ||
import { runScript } from '@pact-toolbox/script'; | ||
import { logger } from '@pact-toolbox/utils'; | ||
import { defineCommand } from 'citty'; | ||
|
||
export const runCommand = defineCommand({ | ||
export const resetCommand = defineCommand({ | ||
meta: { | ||
name: 'run', | ||
description: 'Run a script with the toolbox runtime', | ||
name: 'reset', | ||
description: 'Reset the an exercise', | ||
}, | ||
args: { | ||
script: { | ||
type: 'positional', | ||
name: 'script', | ||
description: 'Script to run', | ||
required: true, | ||
}, | ||
start: { | ||
type: 'boolean', | ||
name: 'start', | ||
alias: 's', | ||
description: 'Start the network before running the script', | ||
required: false, | ||
default: true, | ||
}, | ||
network: { | ||
type: 'string', | ||
name: 'network', | ||
alias: 'n', | ||
description: 'Network to use', | ||
required: false, | ||
default: 'local', | ||
}, | ||
}, | ||
run: async ({ args }) => { | ||
const { script, network, start, ...rest } = args; | ||
logger.start(`Running script ${script} on network ${network}`); | ||
await runScript(script, { | ||
network, | ||
args: rest, | ||
scriptOptions: { | ||
autoStartNetwork: start, | ||
}, | ||
}); | ||
args: {}, | ||
run: async () => { | ||
logger.error(`Reset command is not implemented yet.`); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,13 @@ | ||
import { runScript } from '@pact-toolbox/script'; | ||
import { logger } from '@pact-toolbox/utils'; | ||
import { defineCommand } from 'citty'; | ||
|
||
export const runCommand = defineCommand({ | ||
meta: { | ||
name: 'run', | ||
description: 'Run a script with the toolbox runtime', | ||
description: 'Run the exercise', | ||
}, | ||
args: { | ||
script: { | ||
type: 'positional', | ||
name: 'script', | ||
description: 'Script to run', | ||
required: true, | ||
}, | ||
start: { | ||
type: 'boolean', | ||
name: 'start', | ||
alias: 's', | ||
description: 'Start the network before running the script', | ||
required: false, | ||
default: true, | ||
}, | ||
network: { | ||
type: 'string', | ||
name: 'network', | ||
alias: 'n', | ||
description: 'Network to use', | ||
required: false, | ||
default: 'local', | ||
}, | ||
}, | ||
run: async ({ args }) => { | ||
const { script, network, start, ...rest } = args; | ||
logger.start(`Running script ${script} on network ${network}`); | ||
await runScript(script, { | ||
network, | ||
args: rest, | ||
scriptOptions: { | ||
autoStartNetwork: start, | ||
}, | ||
}); | ||
args: {}, | ||
run: async ({}) => { | ||
logger.error(`Run command is not implemented yet.`); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { logger } from '@pact-toolbox/utils'; | ||
import { defineCommand } from 'citty'; | ||
|
||
export const watchCommand = defineCommand({ | ||
meta: { | ||
name: 'watch', | ||
description: '', | ||
description: 'Watch the exercise', | ||
}, | ||
run: async () => { | ||
logger.error(`Watch command is not implemented yet.`); | ||
}, | ||
run: async () => {}, | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.