Skip to content

Commit

Permalink
returning directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Tran authored and Jacob Tran committed Jun 19, 2018
1 parent 2071d96 commit a9674d4
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,12 +60,10 @@ function getEnvIdFromBranch () {
try {
let branch = sh.exec('git name-rev HEAD --name-only').stdout

branch = _.trimEnd(_.truncate(branch, {
return _.trimEnd(_.truncate(branch, {
length: 13,
omission: ''
}), '-')

return branch
} catch (e) {
console.log('ERR: ', e)
// Do nothing
Expand Down
4 changes: 1 addition & 3 deletions test/_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ const sh = require('shelljs')
module.exports = function (regex) {
var env = sh.exec('git name-rev HEAD --name-only').stdout

env = env ? _.truncate(env, {
return env ? _.truncate(env, {
length: 13,
omission: ''
}) : undefined

return env
}

0 comments on commit a9674d4

Please sign in to comment.