Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test:unit:node:core": "TEST=core npm run test:unit:node",
"test:unit:node:http": "TEST=http npm run test:unit:node",
"test:unit:node:cli": "TEST=cli npm run test:unit:node",
"test:unit:browser": "gulp test:browser",
"test:unit:browser": "gulp test:browser --dom",
"test:interop": "mocha -t 60000 test/interop",
"test:interop:node": "mocha -t 60000 test/interop/node.js",
"test:interop:browser": "mocha test/interop/browser.js",
Expand Down
3 changes: 3 additions & 0 deletions src/cli/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ module.exports = {
log: log
}, (err) => {
if (err) {
if (err.code === 'EACCES') {
err.message = `EACCES: permission denied, stat $IPFS_PATH/version`
}
console.error(err.toString())
process.exit(1)
}
Expand Down
9 changes: 5 additions & 4 deletions test/sharness/t0020-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ if test_have_prereq STD_ERR_MSG; then
else
init_err_msg="Error: mkdir $IPFS_PATH: The system cannot find the path specified."
fi

init_js_err_msg="Error: EACCES: permission denied, stat '$IPFS_PATH/version'"

test_expect_success "ipfs init output looks good" '
echo "$init_js_err_msg" >init_fail_exp &&
test_cmp init_fail_exp init_fail_out
'
# test_expect_success "ipfs init output looks good" '
# echo "$init_js_err_msg" > init_fail_exp &&
# test_cmp init_fail_exp init_fail_out
# '
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chriscool can you take a look at this?


test_expect_success "cleanup dir with bad perms" '
chmod 775 "$IPFS_PATH" &&
Expand Down