This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-24
lines changed Expand file tree Collapse file tree 3 files changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ function IPFS (repo) {
8989 }
9090
9191 this . repo = {
92- init : ( bits , force , empty , callback ) => {
92+ init : ( bits , empty , callback ) => {
9393 // 1. check if repo already exists
9494 } ,
9595
Original file line number Diff line number Diff line change @@ -5,18 +5,17 @@ const path = require('path')
55
66module . exports = ( repo , opts , callback ) => {
77 opts = opts || { }
8- opts . force = opts . force || false
98 opts . emptyRepo = opts . emptyRepo || false
109 opts . bits = opts . bits || 2048
1110
1211 // Pre-set config values.
1312 var config = require ( '../init-files/default-config.json' )
1413
15- // Verify repo does not yet exist (or that 'force' is provided) .
14+ // Verify repo does not yet exist.
1615 repo . exists ( ( err , res ) => {
1716 if ( err ) { return callback ( err ) }
18- if ( res === true && ! opts . force ) {
19- return callback ( new Error ( 'repo already exists and \'force\' is not set ' ) )
17+ if ( res === true ) {
18+ return callback ( new Error ( 'repo already exists' ) )
2019 }
2120
2221 generateAndSetKeypair ( )
Original file line number Diff line number Diff line change @@ -53,23 +53,4 @@ describe('init', function () {
5353 } )
5454 } )
5555 } )
56-
57- it ( 'force init (overwrite)' , ( done ) => {
58- var repo = createTempRepo ( )
59- const ipfs1 = new IPFS ( repo )
60- const ipfs2 = new IPFS ( repo )
61- ipfs1 . init ( { bits : 128 , emptyRepo : true } , ( err ) => {
62- expect ( err ) . to . not . exist
63-
64- ipfs2 . init ( { bits : 128 , force : false } , ( err ) => {
65- expect ( err ) . to . exist
66-
67- ipfs2 . init ( { force : true } , ( err ) => {
68- expect ( err ) . to . not . exist
69-
70- repo . teardown ( done )
71- } )
72- } )
73- } )
74- } )
7556} )
You can’t perform that action at this time.
0 commit comments