-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wrangler init
throws an error if git
is not available
#1022
Labels
bug
Something that isn't working
Comments
Hmm, strange. That should have been fixed by 1caa5f7 |
I think that the fix expects the process not to throw an exception but just return a non-zero Perhaps on Windows the behaviour is different? |
threepointone
changed the title
error
May 16, 2022
wrangler init
throws an error if git
is not available
petebacondarwin
added a commit
to petebacondarwin/wrangler2
that referenced
this issue
May 16, 2022
We check for the presence of Git by trying to run `git --version`. On non-Windows we get an Error with `code` set to "ENOENT". One Windows we get a different error: ``` { "shortMessage":"Command failed with exit code 1: git --version", "command":"git --version", "escapedCommand":"git --version", "exitCode":1, "stdout":"", "stderr":"'git' is not recognized as an internal or external command,\r\noperable program or batch file.", "failed":true, "timedOut":false, "isCanceled":false, "killed":false } ``` Since we don't really care what the error is, now we just assume that Git is not available if an error is thrown. Fixes cloudflare#1022
petebacondarwin
added a commit
that referenced
this issue
May 16, 2022
…ows (#1033) We check for the presence of Git by trying to run `git --version`. On non-Windows we get an Error with `code` set to "ENOENT". One Windows we get a different error: ``` { "shortMessage":"Command failed with exit code 1: git --version", "command":"git --version", "escapedCommand":"git --version", "exitCode":1, "stdout":"", "stderr":"'git' is not recognized as an internal or external command,\r\noperable program or batch file.", "failed":true, "timedOut":false, "isCanceled":false, "killed":false } ``` Since we don't really care what the error is, now we just assume that Git is not available if an error is thrown. Fixes #1022
Repository owner
moved this from In Review
to Done
in workers-sdk
May 16, 2022
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
while using this command, i get this error
npx wrangler init my-worker
⛅️ wrangler 2.0.5
Using npm as package manager.
✨ Created my-worker\wrangler.toml
X [ERROR] Command failed with exit code 1: git --version
'git' is not recognized as an internal or external command,
operable program or batch file.
The text was updated successfully, but these errors were encountered: