We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5adcd47 commit d18b89fCopy full SHA for d18b89f
bin/lib/cli.js
@@ -25,8 +25,9 @@ function getVersion () {
25
// Obtain version from git
26
const options = { cwd: __dirname, encoding: 'utf8' }
27
const { stdout } = spawnSync('git', ['describe', '--tags'], options)
28
+ const { stdout: gitStatusStdout } = spawnSync('git', ['status'], options)
29
const version = stdout.trim()
- if (version === '') {
30
+ if (version === '' || gitStatusStdout.match('Not currently on any branch')) {
31
throw new Error('No git version here')
32
}
33
return version
0 commit comments