Skip to content

Commit

Permalink
refactor: remove unnecessary try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj authored and okonet committed Aug 17, 2019
1 parent 94dbeda commit 23019a5
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/execGit.js
Expand Up @@ -5,13 +5,9 @@ const execa = require('execa')

module.exports = async function execGit(cmd, options = {}) {
debug('Running git command', cmd)
try {
const { stdout } = await execa('git', [].concat(cmd), {
...options,
cwd: options.cwd || process.cwd()
})
return stdout
} catch (err) {
throw new Error(err)
}
const { stdout } = await execa('git', [].concat(cmd), {
...options,
cwd: options.cwd || process.cwd()
})
return stdout
}

0 comments on commit 23019a5

Please sign in to comment.