(newVer: string)
| 77 | }; |
| 78 | |
| 79 | const bump = (newVer: string): { code: number } => { |
| 80 | const script = ` |
| 81 | cd "${dir}" || exit 2 |
| 82 | NEW_VERSION="${newVer}" |
| 83 | if ! printf '%s' "$NEW_VERSION" | grep -qE '^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$'; then |
| 84 | echo "invalid semver" >&2; exit 1 |
| 85 | fi |
| 86 | echo "$NEW_VERSION" > VERSION |
| 87 | if [ -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" |
| 89 | fi`; |
| 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 | |
| 98 | const syncRepair = (): { code: number } => { |
| 99 | const script = ` |
no outgoing calls
no test coverage detected