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

fix(cli): Fix issue with right cwd not being set #503

Merged
merged 1 commit into from
Sep 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
})
})
})