silverwolf-x/project / scripts /check-is-release.js
silverwolf-x's picture
download
raw
706 Bytes
const { execSync } = require('child_process')
const checkIsRelease = async () => {
let commitId = process.argv[2] || ''
// parse only the last string which should be version if
// it's a publish commit
const commitMsg = execSync(
`git log -n 1 --pretty='format:%B'${commitId ? ` ${commitId}` : ''}`
)
.toString()
.trim()
const versionString = commitMsg.split(' ').pop().trim()
const publishMsgRegex = /^v\d{1,}\.\d{1,}\.\d{1,}(-\w{1,}\.\d{1,})?$/
if (publishMsgRegex.test(versionString)) {
console.log(versionString)
process.exit(0)
} else {
console.log('not publish commit', { commitId, commitMsg, versionString })
process.exit(1)
}
}
checkIsRelease()

Xet Storage Details

Size:
706 Bytes
·
Xet hash:
a0265267fc4ecd0e7871387ba3bfe4c29da09d18ed7d1f6844bf8c46c092f99e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.