Skip to content

Commit 58c0cfd

Browse files
committed
Generalize version bump script messages
1 parent 835992f commit 58c0cfd

1 file changed

Lines changed: 17 additions & 23 deletions

File tree

‎apps/editor/scripts/bump.ts‎

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,23 @@ const rl = readline.createInterface({
2323
output: process.stdout
2424
})
2525

26-
rl.question(
27-
`Bump version of the VS Code extension to ${next_version}? (y/N) `,
28-
(answer: string) => {
29-
if (answer.toLowerCase() === 'y') {
30-
pkg.version = next_version
31-
fs.writeFileSync(pkg_path, JSON.stringify(pkg, null, 2) + '\n')
32-
console.log(`Bumped version of the VS Code extension to ${pkg.version}`)
26+
rl.question(`Bump version to ${next_version}? (y/N) `, (answer: string) => {
27+
if (answer.toLowerCase() === 'y') {
28+
pkg.version = next_version
29+
fs.writeFileSync(pkg_path, JSON.stringify(pkg, null, 2) + '\n')
30+
console.log(`Bumped version to ${pkg.version}`)
3331

34-
try {
35-
execSync(`git add "${pkg_path}"`, { stdio: 'ignore' })
36-
execSync(
37-
`git commit --no-verify -m "Bump version of the VS Code extension to ${pkg.version}"`,
38-
{
39-
stdio: 'ignore'
40-
}
41-
)
42-
console.log('Successfully committed the version bump.')
43-
} catch (error: any) {
44-
console.error('Failed to commit version bump:', error.message)
45-
}
46-
} else {
47-
console.log('Version bump aborted.')
32+
try {
33+
execSync(`git add "${pkg_path}"`, { stdio: 'ignore' })
34+
execSync(`git commit --no-verify -m "Bump version to ${pkg.version}"`, {
35+
stdio: 'ignore'
36+
})
37+
console.log('Successfully committed the version bump.')
38+
} catch (error: any) {
39+
console.error('Failed to commit version bump:', error.message)
4840
}
49-
rl.close()
41+
} else {
42+
console.log('Version bump aborted.')
5043
}
51-
)
44+
rl.close()
45+
})

0 commit comments

Comments
 (0)