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 217e8e3 commit acc2401Copy full SHA for acc2401
bin/lib/cli.js
@@ -25,10 +25,15 @@ function getVersion () {
25
// Obtain version from git
26
const options = { cwd: __dirname, encoding: 'utf8' }
27
const { stdout } = spawnSync('git', ['describe', '--tags'], options)
28
- return stdout.trim()
+ const version = stdout.trim()
29
+ if (version === '') {
30
+ throw new Error('No git version here')
31
+ }
32
+ return version
33
} catch (e) {
34
// Obtain version from package.json
35
const { version } = require(path.join(__dirname, '../../package.json'))
36
return version
37
}
38
39
+
0 commit comments