Skip to content

Commit

Permalink
fix: resolve cli-style path by using dirname
Browse files Browse the repository at this point in the history
  • Loading branch information
varl committed Feb 7, 2019
1 parent 3ebbc9f commit 3a61532
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,7 @@ function writeFile(fp, content) {
}

function cwd() {
try {
const nodeModulePath = path.join(
process.cwd(),
'node_modules',
'@dhis2',
'code-style'
)
fs.accessSync(nodeModulePath)
return nodeModulePath
} catch (err) {
log.debug(
`could not find 'node_modules/@dhis2/code-style' in '${process.cwd()}', falling back to latter.`
)
return process.cwd()
}
return path.join(__dirname, '..')
}

module.exports = {
Expand Down

0 comments on commit 3a61532

Please sign in to comment.