Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 782b5c0

Browse files
committed
chore: guard on cid-version input
License: MIT Signed-off-by: achingbrain <[email protected]>
1 parent d4d0663 commit 782b5c0

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

src/cli/mkdir.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ module.exports = {
1919
},
2020
cidVersion: {
2121
alias: ['cid-ver', 'cid-version'],
22-
type: 'integer',
22+
type: 'number',
23+
default: 0,
2324
describe: 'Cid version to use. (experimental).'
2425
},
2526
hash: {

src/cli/write.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ module.exports = {
6767
cidVersion: {
6868
alias: ['cid-ver', 'cid-version'],
6969
type: 'number',
70-
default: 0
70+
default: 0,
71+
describe: 'Cid version to use. (experimental).'
7172
},
7273
hashAlg: {
7374
alias: 'h',

src/core/mkdir.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module.exports = (ipfs) => {
2525
options = Object.assign({}, defaultOptions, options)
2626

2727
options.parents = options.p || options.parents
28+
options.cidVersion = options.cidVersion || 0
2829

2930
if (!path) {
3031
return callback(new Error('no path given to Mkdir'))

src/core/write/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ module.exports = function mfsWrite (ipfs) {
120120
options.length = Infinity
121121
}
122122

123+
options.cidVersion = options.cidVersion || 0
124+
123125
waterfall([
124126
(done) => {
125127
parallel([

0 commit comments

Comments
 (0)