Skip to content

Commit

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

branch = branch.split('/')

branch = branch[branch.length - 1]
branch = _.last(_.split(branch, '/'))

return _.trimEnd(_.truncate(branch, {
length: 13,
Expand Down
4 changes: 1 addition & 3 deletions test/_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ 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]
env = _.last(_.split(env, '/'))

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

0 comments on commit 0b1a23e

Please sign in to comment.