Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix(cli): Fix issue with right cwd not being set
Browse files Browse the repository at this point in the history
  • Loading branch information
victorb committed Sep 22, 2016
1 parent 5d82ee3 commit e5f5e1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cli/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const yargs = require('yargs')
const updateNotifier = require('update-notifier')
const readPkgUp = require('read-pkg-up')

const pkg = readPkgUp.sync().pkg
const pkg = readPkgUp.sync({cwd: __dirname}).pkg
updateNotifier({
pkg,
updateCheckInterval: 1000 * 60 * 60 * 24 * 7 // 1 week
Expand Down
9 changes: 9 additions & 0 deletions test/cli/test-commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,13 @@ describe('commands', () => {
done()
})
})
it('list the commands even if not in the same dir', (done) => {
nexpect.spawn('node', [process.cwd() + '/src/cli/bin.js', 'commands'], {cwd: '/tmp'})
.run((err, stdout, exitcode) => {
expect(err).to.not.exist
expect(exitcode).to.equal(0)
expect(stdout.length).to.equal(56)
done()
})
})
})

0 comments on commit e5f5e1b

Please sign in to comment.