Skip to content

Commit

Permalink
fix(pg): use scriptPath positional param in propose CLI command
Browse files Browse the repository at this point in the history
  • Loading branch information
sam-goldman committed Jan 4, 2024
1 parent ecededa commit 30a1296
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-spoons-dress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sphinx-labs/plugins': patch
---

Use scriptPath positional param in propose CLI command
12 changes: 4 additions & 8 deletions packages/plugins/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const coerceNetworks = (
yargs(hideBin(process.argv))
.scriptName('sphinx')
.command(
'propose',
'propose <scriptPath>',
`Propose a deployment by submitting it to Sphinx's backend.`,
(y) =>
y
Expand All @@ -61,6 +61,7 @@ yargs(hideBin(process.argv))
.positional('scriptPath', {
describe: 'Path to the Forge script file.',
type: 'string',
demandOption: true,
})
.option('networks', {
describe: 'The networks to propose on.',
Expand Down Expand Up @@ -89,16 +90,11 @@ yargs(hideBin(process.argv))
boolean: true,
default: false,
})
.hide('version')
.demandCommand(1, 'You must provide a Forge script path.'),
.hide('version'),
async (argv) => {
const { networks, scriptPath, targetContract, silent, dryRun, confirm } =
argv

if (typeof scriptPath !== 'string') {
throw new Error('Script path must be a string.')
}

if (silent && !confirm) {
// Since the '--silent' option silences the preview, the user must confirm the proposal
// via the CLI flag.
Expand Down Expand Up @@ -242,7 +238,7 @@ yargs(hideBin(process.argv))
)
.command(
'deploy',
`Executes the user's 'deploy' function on the given network. Displays a preview before the deployment, and writes artifacts after.`,
`Executes a deployment on a network. Displays a preview before the deployment, and writes artifacts after.`,
(y) =>
y
.usage(
Expand Down

0 comments on commit 30a1296

Please sign in to comment.