Skip to content

Commit

Permalink
fix: πŸ› unknown revision
Browse files Browse the repository at this point in the history
Fixes Chatie#32
  • Loading branch information
binsee committed Sep 29, 2022
1 parent 67b2522 commit 51fd5aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/pre-push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (refs?.[0]?.localCommit.match(/^0+$/)) {
console.info('[Step-1]', 'Checking last commit...', '\n')
const pkgFile = path.join(process.cwd(), 'package.json')
const packageVersion = require(pkgFile).version
const lastCommitMsg = checkReturn(shell.exec('git log --pretty=format:"%s" HEAD^0 -1', { silent : true })).stdout
const lastCommitMsg = checkReturn(shell.exec('git log --pretty=format:"%s" HEAD~0 -1', { silent : true })).stdout

if (packageVersion === lastCommitMsg) {
console.info('[Step-1]', 'No need to bump the package version.', '\n')
Expand All @@ -75,7 +75,7 @@ checkReturn(shell.exec('npm version patch --no-package-lock', { silent : true })
process.env[INNER_PRE_HOOK] = '1'

console.info('[Step-4]', 'Remove git tag...', '\n')
const version = checkReturn(shell.exec('git log --pretty=format:"%s" HEAD^0 -1', { silent : true })).stdout
const version = checkReturn(shell.exec('git log --pretty=format:"%s" HEAD~0 -1', { silent : true })).stdout
checkReturn(shell.exec(`git tag -d v${version}`, { silent : true }))

console.info('[Step-5]', 'Push...', '\n')
Expand Down

0 comments on commit 51fd5aa

Please sign in to comment.