diff --git a/packages/app/src/cli/commands/app/bulk/execute.ts b/packages/app/src/cli/commands/app/bulk/execute.ts index 07e0ed00e4..d54f2d287d 100644 --- a/packages/app/src/cli/commands/app/bulk/execute.ts +++ b/packages/app/src/cli/commands/app/bulk/execute.ts @@ -29,7 +29,7 @@ export default class BulkExecute extends AppLinkedCommand { query, variables: flags.variables, variableFile: flags['variable-file'], - watch: flags.watch, + watch: flags.watch ?? false, outputFile: flags['output-file'], ...(flags.version && {version: flags.version}), }) diff --git a/packages/app/src/cli/flags.ts b/packages/app/src/cli/flags.ts index 85b5969174..e9561dada8 100644 --- a/packages/app/src/cli/flags.ts +++ b/packages/app/src/cli/flags.ts @@ -64,13 +64,14 @@ export const bulkOperationFlags = { parse: async (input) => normalizeStoreFqdn(input), }), watch: Flags.boolean({ - description: 'Wait for bulk operation results before exiting.', + description: 'Wait for bulk operation results before exiting. Defaults to false.', env: 'SHOPIFY_FLAG_WATCH', - default: false, }), 'output-file': Flags.string({ - description: 'The file path where results should be written. If not specified, results will be written to STDOUT.', + description: + 'The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.', env: 'SHOPIFY_FLAG_OUTPUT_FILE', + dependsOn: ['watch'], }), version: Flags.string({ description: 'The API version to use for the bulk operation. If not specified, uses the latest stable version.', diff --git a/packages/cli/oclif.manifest.json b/packages/cli/oclif.manifest.json index da5f1d81b8..160ddd015c 100644 --- a/packages/cli/oclif.manifest.json +++ b/packages/cli/oclif.manifest.json @@ -125,7 +125,10 @@ "type": "boolean" }, "output-file": { - "description": "The file path where results should be written. If not specified, results will be written to STDOUT.", + "dependsOn": [ + "watch" + ], + "description": "The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.", "env": "SHOPIFY_FLAG_OUTPUT_FILE", "hasDynamicHelp": false, "multiple": false, @@ -212,7 +215,7 @@ }, "watch": { "allowNo": false, - "description": "Wait for bulk operation results before exiting.", + "description": "Wait for bulk operation results before exiting. Defaults to false.", "env": "SHOPIFY_FLAG_WATCH", "name": "watch", "type": "boolean"