forked from leung018/zero-in
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.js
More file actions
25 lines (20 loc) · 655 Bytes
/
release.js
File metadata and controls
25 lines (20 loc) · 655 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { execSync } from 'child_process'
import process from 'process'
if (process.argv.length < 3) {
console.error('Usage: node release.js <tag>')
process.exit(1)
}
const tag = process.argv[2]
const message = `my version ${tag}`
try {
console.log(`Creating tag: ${tag}`)
execSync(`git tag -a ${tag} -m "${message}"`, { stdio: 'inherit' })
console.log(`Pushing tag: ${tag}`)
execSync(`git push origin ${tag}`, { stdio: 'inherit' })
console.log(
`Tag pushed successfully!\nPlease download the release and upload it to the Chrome Web Store.`
)
} catch (error) {
console.error('Error occurred:', error.message)
process.exit(1)
}