Skip to content

Commit

Permalink
fix: error message change if git command fails to execute
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigodosanjosoliveira committed May 16, 2022
1 parent 127b1c8 commit 9772757
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/generators/src/infra/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ module.exports =
const { spawnSync } = require('child_process')
const where = platform === 'win32' ? 'where.exe' : 'which'
const out = spawnSync(where, ['git'])

if (out.exitCode === 1) {
process.stdout.write(`Git not found\n`)
if (out.status === 1) {
process.stdout.write(`[ERROR] Git not found\n install it via https://git-scm.com/downloads and try again, or skip the git option when generates a new project with Herbs-CLI\n`)
} else {
process.stdout.write(`Generating git\n`)
await generate({
Expand Down

0 comments on commit 9772757

Please sign in to comment.