From ff4e09b105c6274537b2456bac1dcd6937527a89 Mon Sep 17 00:00:00 2001 From: James Meng Date: Wed, 11 Dec 2024 17:26:45 -0800 Subject: [PATCH] Validate that generate path points to a valid theme directories --- packages/cli/README.md | 9 +++-- packages/cli/oclif.manifest.json | 24 ++++++++++++ .../cli/commands/theme/generate/block.test.ts | 39 +++++++++++++++++++ .../src/cli/commands/theme/generate/block.ts | 17 +++++++- .../commands/theme/generate/section.test.ts | 39 +++++++++++++++++++ .../cli/commands/theme/generate/section.ts | 17 +++++++- .../commands/theme/generate/template.test.ts | 39 +++++++++++++++++++ .../cli/commands/theme/generate/template.ts | 17 +++++++- 8 files changed, 195 insertions(+), 6 deletions(-) create mode 100644 packages/theme/src/cli/commands/theme/generate/block.test.ts create mode 100644 packages/theme/src/cli/commands/theme/generate/section.test.ts create mode 100644 packages/theme/src/cli/commands/theme/generate/template.test.ts diff --git a/packages/cli/README.md b/packages/cli/README.md index 7b071557cf4..0e3940be1dc 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1904,10 +1904,11 @@ Creates and adds a new block file to your local theme directory ``` USAGE - $ shopify theme generate block [-n ] [--no-color] [--path ] [-t text|image|video|product|collection] + $ shopify theme generate block [-f] [-n ] [--no-color] [--path ] [-t text|image|video|product|collection] [--verbose] FLAGS + -f, --force Overwrite existing files -n, --name= Name of the block -t, --type=