Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions cli/nodeutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export async function npmVersionBumpAsync(
): Promise<string> {
const output = await spawnWithPipeAsync({
cmd: addCmd("npm"),
args: ["version", bumpType, "--message", `"[pxt-cli] bump version to %s"`, "--git-tag-version", tagCommit ? "true" : "false"],
args: ["version", bumpType, "--message", quoteIfNeeded(`[pxt-cli] bump version to %s`), "--git-tag-version", tagCommit ? "true" : "false"],
cwd: ".",
silent: true,
});
Expand All @@ -299,14 +299,21 @@ export async function npmVersionBumpAsync(
});
await spawnAsync({
cmd: "git",
args: ["commit", "-m", `"[pxt-cli] bump version to ${ver}"`],
args: ["commit", "-m", quoteIfNeeded(`[pxt-cli] bump version to ${ver}`)],
cwd: ".",
silent: true,
});
}
return ver;
}

function quoteIfNeeded(arg: string) {
if (os.platform() === "win32") {
return `"${arg}"`;
}
return arg;
}

export function gitPushAsync(followTags: boolean = true) {
const args = ["push"];
if (followTags) args.push("--follow-tags");
Expand Down