Skip to content

Commit e794f12

Browse files
Merge pull request #6691 from Shopify/app_bulk_execute_no_output_file_without_watch
Make `--output-file` flag dependent on `--watch` in bulk operations
2 parents 23c136c + 31337c0 commit e794f12

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

packages/app/src/cli/commands/app/bulk/execute.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class BulkExecute extends AppLinkedCommand {
2929
query,
3030
variables: flags.variables,
3131
variableFile: flags['variable-file'],
32-
watch: flags.watch,
32+
watch: flags.watch ?? false,
3333
outputFile: flags['output-file'],
3434
...(flags.version && {version: flags.version}),
3535
})

packages/app/src/cli/flags.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,14 @@ export const bulkOperationFlags = {
6464
parse: async (input) => normalizeStoreFqdn(input),
6565
}),
6666
watch: Flags.boolean({
67-
description: 'Wait for bulk operation results before exiting.',
67+
description: 'Wait for bulk operation results before exiting. Defaults to false.',
6868
env: 'SHOPIFY_FLAG_WATCH',
69-
default: false,
7069
}),
7170
'output-file': Flags.string({
72-
description: 'The file path where results should be written. If not specified, results will be written to STDOUT.',
71+
description:
72+
'The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.',
7373
env: 'SHOPIFY_FLAG_OUTPUT_FILE',
74+
dependsOn: ['watch'],
7475
}),
7576
version: Flags.string({
7677
description: 'The API version to use for the bulk operation. If not specified, uses the latest stable version.',

packages/cli/oclif.manifest.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@
125125
"type": "boolean"
126126
},
127127
"output-file": {
128-
"description": "The file path where results should be written. If not specified, results will be written to STDOUT.",
128+
"dependsOn": [
129+
"watch"
130+
],
131+
"description": "The file path where results should be written if --watch is specified. If not specified, results will be written to STDOUT.",
129132
"env": "SHOPIFY_FLAG_OUTPUT_FILE",
130133
"hasDynamicHelp": false,
131134
"multiple": false,
@@ -212,7 +215,7 @@
212215
},
213216
"watch": {
214217
"allowNo": false,
215-
"description": "Wait for bulk operation results before exiting.",
218+
"description": "Wait for bulk operation results before exiting. Defaults to false.",
216219
"env": "SHOPIFY_FLAG_WATCH",
217220
"name": "watch",
218221
"type": "boolean"

0 commit comments

Comments
 (0)