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

Commit

Permalink
fix: init.bits should be a number
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Nov 2, 2020
1 parent 417abf7 commit 9d89802
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/interface-ipfs-core/src/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module.exports = (common, options) => {

after(() => common.clean())

it('should respect timeout option when adding files', () => {
it('should respect timeout option when adding file', () => {
return testTimeout(() => ipfs.add('Hello', {
timeout: 1
}))
Expand Down
9 changes: 8 additions & 1 deletion packages/ipfs-cli/src/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ module.exports = {
type: 'number',
alias: 'b',
default: '2048',
describe: 'Number of bits to use in the generated RSA private key (defaults to 2048)'
describe: 'Number of bits to use in the generated RSA private key (defaults to 2048)',
coerce: (value) => {
return Number(value)
}
})
.option('empty-repo', {
alias: 'e',
Expand Down Expand Up @@ -69,6 +72,7 @@ module.exports = {
const IPFS = require('ipfs-core')
const Repo = require('ipfs-repo')

console.log(typeof argv.bits)
try {
await IPFS.create({
repo: new Repo(repoPath),
Expand All @@ -84,7 +88,10 @@ module.exports = {
// @ts-ignore - Expects more than {}
config
})

console.log('<<< initialized')
} catch (err) {
console.error(err)
if (err.code === 'EACCES') {
err.message = 'EACCES: permission denied, stat $IPFS_PATH/version'
}
Expand Down

0 comments on commit 9d89802

Please sign in to comment.