MCPcopy Create free account
hub / github.com/garrytan/gstack / bump

Function bump

test/ship-version-sync.test.ts:79–96  ·  view source on GitHub ↗
(newVer: string)

Source from the content-addressed store, hash-verified

77};
78
79const bump = (newVer: string): { code: number } => {
80 const script = `
81cd "${dir}" || exit 2
82NEW_VERSION="${newVer}"
83if ! printf '%s' "$NEW_VERSION" | grep -qE '^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$'; then
84 echo "invalid semver" >&2; exit 1
85fi
86echo "$NEW_VERSION" > VERSION
87if [ -f package.json ]; then
88 node -e 'const fs=require("fs"),p=require("./package.json");p.version=process.argv[1];fs.writeFileSync("package.json",JSON.stringify(p,null,2)+"\\n")' "$NEW_VERSION"
89fi`;
90 try {
91 execSync(script, { shell: "/bin/bash", stdio: "pipe" });
92 return { code: 0 };
93 } catch (e: any) {
94 return { code: e.status ?? 1 };
95 }
96};
97
98const syncRepair = (): { code: number } => {
99 const script = `

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected