Skip to content
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

fix: Ensure getting git branch doesn't fail on Windows #914

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 3 additions & 8 deletions packages/wrangler/src/pages.tsx
Expand Up @@ -925,10 +925,7 @@ const createDeployment: CommandModule<
"Enter the production branch name:",
"text",
isGitDir
? execSync(`git branch | grep "* "`)
.toString()
.replace("* ", "")
.trim()
? execSync(`git rev-parse --abbrev-ref HEAD`).toString().trim()
: "production"
);

Expand Down Expand Up @@ -979,9 +976,8 @@ const createDeployment: CommandModule<
);

if (!branch) {
branch = execSync(`git branch | grep "* "`)
branch = execSync(`git rev-parse --abbrev-ref HEAD`)
.toString()
.replace("* ", "")
.trim();
}

Expand Down Expand Up @@ -1682,9 +1678,8 @@ export const pages: BuilderCallback<unknown, unknown> = (yargs) => {
"Enter the production branch name:",
"text",
isGitDir
? execSync(`git branch | grep "* "`)
? execSync(`git rev-parse --abbrev-ref HEAD`)
.toString()
.replace("* ", "")
.trim()
: "production"
);
Expand Down