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 ( '../../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 @@ -101,23 +101,4 @@ describe('init', function () {
101101 } )
102102 } )
103103 } )
104-
105- it ( 'force init (overwrite)' , ( done ) => {
106- var repo = createTestRepo ( )
107- const ipfs1 = new IPFS ( repo )
108- const ipfs2 = new IPFS ( repo )
109- ipfs1 . init ( { bits : 128 , emptyRepo : true } , ( err ) => {
110- expect ( err ) . to . not . exist
111-
112- ipfs2 . init ( { bits : 128 , force : false } , ( err ) => {
113- expect ( err ) . to . exist
114-
115- ipfs2 . init ( { force : true } , ( err ) => {
116- expect ( err ) . to . not . exist
117-
118- repo . teardown ( done )
119- } )
120- } )
121- } )
122- } )
123104} )
You can’t perform that action at this time.
0 commit comments