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

Commit ea8de20

Browse files
authored
Merge pull request #896 from ipfs/fix/daemon-start
fix: not masking error message when starting daemon
2 parents ce504cd + fe48c3e commit ea8de20

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/cli/commands/daemon.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ module.exports = {
2828
httpAPI = new HttpAPI(process.env.IPFS_PATH, argv)
2929

3030
httpAPI.start((err) => {
31-
if (err && err.code === 'ENOENT') {
32-
console.log('Error: no ipfs repo found in ' + repoPath)
31+
if (err && err.code === 'ENOENT' && err.message.match(/Uninitalized repo/i)) {
32+
console.log('Error: no initialized ipfs repo found in ' + repoPath)
3333
console.log('please run: jsipfs init')
3434
process.exit(1)
3535
}

test/cli/daemon.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('daemon', () => {
1717
afterEach(() => clean(repoPath))
1818

1919
it('gives error if user hasn\'t run init before', (done) => {
20-
const expectedError = 'no ipfs repo found in ' + repoPath
20+
const expectedError = 'no initialized ipfs repo found in ' + repoPath
2121

2222
ipfs('daemon').catch((err) => {
2323
expect(err.stdout).to.have.string(expectedError)

0 commit comments

Comments
 (0)