Skip to content

Commit

Permalink
feat(syntax): Fix the syntax error
Browse files Browse the repository at this point in the history
  • Loading branch information
maticzav committed Mar 24, 2018
1 parent 08ddc75 commit 426f14e
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/emma.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,22 @@ const maxCellSize = () => terminal().columns / 4

// Yarn

const isYarnInstalled = () => exec(`yarnpkg --version`, { stdio: `ignore` })
.then(() => true)
.catch(() => false)

const shouldUseYarn = () => {
return canAccessFile('package-lock.json')
.then(() => false)
.catch(isYarnInstalled)
const isYarnInstalled = async () => {
try {
await exec(`yarnpkg --version`, { stdio: `ignore` })
return true
} catch (err) {
return false
}
}

const shouldUseYarn = async () => {
try {
await canAccessFile('package-lock.json')
return false
} catch (err) {
return isYarnInstalled()
}
}

// Additional
Expand Down

0 comments on commit 426f14e

Please sign in to comment.