fix: Windows ENOENT by enabling shell resolution for Shopify CLI#47
Open
Xurya wants to merge 1 commit intoShopify:mainfrom
Open
fix: Windows ENOENT by enabling shell resolution for Shopify CLI#47Xurya wants to merge 1 commit intoShopify:mainfrom
Xurya wants to merge 1 commit intoShopify:mainfrom
Conversation
Enable the shell option when spawning processes on Windows (shell: process.platform === "win32") to ensure resolution of .cmd executables. This prevents failures when invoking tools that rely on Windows command wrappers.
97768ec to
176d9ac
Compare
Author
|
I have signed the CLA! |
Merged
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
shell: trueon Windows when spawning the Shopify CLI to fix ENOENT failures.Problem
spawn('shopify', ...)can fail with ENOENT even whenshopify.cmdexists andwhere shopifyresolves it.spawndoes not resolve.cmdwithout a shell, causing CLI commands (build/info) to fail under certain PATH/env conditions.Fix
shell: trueon Windows for the shopify child process as a fallback.Rationale
Validation
buildandinfocommands succeed under tests.Note
Please test extensively, modify as needed. I've only tested on my local machines and environments (one Windows and one macOS Tahoe v26.0.1)
Potential Improvements / Alternatives
SHOPIFY_CLI_PATHto explicitly point at the CLI binary.shell: false. If local CLI not found, use globalshopifywithshell: trueonly on Windows.cwd, chosen CLI path, and actionable guidance (e.g., install local CLI or set override).