We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dc7fdde commit 769c987Copy full SHA for 769c987
2 files changed
git-consistent
@@ -93,4 +93,5 @@ try {
93
}
94
} catch (e) {
95
console.error(`${colors.error}${e.message}${colors.reset}`)
96
+ e.status ? process.exit(e.status) : process.exit(1)
97
lib/main.js
@@ -9,9 +9,18 @@ const colors = require('./colors')
9
// Functions
10
//
11
const getCurrentBranchName = () => {
12
- return execSync('git rev-parse --abbrev-ref HEAD')
13
- .toString()
14
- .trim()
+ try {
+ return execSync('git rev-parse --abbrev-ref HEAD 2> /dev/null')
+ .toString()
15
+ .trim()
16
+ } catch (e) {
17
+ // it is First Commit
18
+ if (e.status === 128) {
19
+ return ''
20
+ } else {
21
+ throw e
22
+ }
23
24
25
26
const branchText = (definition) => {
0 commit comments