Skip to content

Commit

Permalink
Use path.basename instead of unix basename which fails on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-meacham committed Apr 30, 2019
1 parent e419ff3 commit 8fd8973
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// TODO: Consider using nodegit instead
import childProcess from 'child_process'
import path from 'path'

const GIT_PREFIX = 'git'

Expand Down Expand Up @@ -71,7 +72,8 @@ export default class ServerlessGitVariables {
value = `${changes.length > 0}`
break
case 'repository':
value = await _exec('basename `git rev-parse --show-toplevel`')
const pathName = await _exec('git rev-parse --show-toplevel')
value = path.basename(pathName)
break
default:
throw new Error(`Git variable ${variable} is unknown. Candidates are 'describe', 'describeLight', 'sha1', 'commit', 'branch', 'message', 'repository'`)
Expand Down

0 comments on commit 8fd8973

Please sign in to comment.