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

Commit 9d89802

Browse files
committed
fix: init.bits should be a number
1 parent 417abf7 commit 9d89802

File tree

2 files changed

+9
-2
lines changed
  • packages

2 files changed

+9
-2
lines changed

packages/interface-ipfs-core/src/add.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ module.exports = (common, options) => {
5555

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

58-
it('should respect timeout option when adding files', () => {
58+
it('should respect timeout option when adding file', () => {
5959
return testTimeout(() => ipfs.add('Hello', {
6060
timeout: 1
6161
}))

packages/ipfs-cli/src/commands/init.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ module.exports = {
2727
type: 'number',
2828
alias: 'b',
2929
default: '2048',
30-
describe: 'Number of bits to use in the generated RSA private key (defaults to 2048)'
30+
describe: 'Number of bits to use in the generated RSA private key (defaults to 2048)',
31+
coerce: (value) => {
32+
return Number(value)
33+
}
3134
})
3235
.option('empty-repo', {
3336
alias: 'e',
@@ -69,6 +72,7 @@ module.exports = {
6972
const IPFS = require('ipfs-core')
7073
const Repo = require('ipfs-repo')
7174

75+
console.log(typeof argv.bits)
7276
try {
7377
await IPFS.create({
7478
repo: new Repo(repoPath),
@@ -84,7 +88,10 @@ module.exports = {
8488
// @ts-ignore - Expects more than {}
8589
config
8690
})
91+
92+
console.log('<<< initialized')
8793
} catch (err) {
94+
console.error(err)
8895
if (err.code === 'EACCES') {
8996
err.message = 'EACCES: permission denied, stat $IPFS_PATH/version'
9097
}

0 commit comments

Comments
 (0)