Skip to content

Commit

Permalink
Merge pull request #10 from Nordstrom/older-git-compat
Browse files Browse the repository at this point in the history
Older git compat
  • Loading branch information
jollyromp authored Jun 20, 2018
2 parents 75660fe + 9cd6c08 commit 36f3b69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function getEnvIdFromBranch () {
try {
let branch = sh.exec('git name-rev HEAD --name-only').stdout

branch = branch.split('/')

branch = branch[branch.length - 1]

return _.trimEnd(_.truncate(branch, {
length: 13,
omission: ''
Expand Down
4 changes: 4 additions & 0 deletions test/_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ const sh = require('shelljs')
module.exports = function (regex) {
var env = sh.exec('git name-rev HEAD --name-only').stdout

env = env.split('/')

env = env[env.length - 1]

return env ? _.truncate(env, {
length: 13,
omission: ''
Expand Down

0 comments on commit 36f3b69

Please sign in to comment.