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) {
89
89
}
90
90
91
91
this . repo = {
92
- init : ( bits , force , empty , callback ) => {
92
+ init : ( bits , empty , callback ) => {
93
93
// 1. check if repo already exists
94
94
} ,
95
95
Original file line number Diff line number Diff line change @@ -5,18 +5,17 @@ const path = require('path')
5
5
6
6
module . exports = ( repo , opts , callback ) => {
7
7
opts = opts || { }
8
- opts . force = opts . force || false
9
8
opts . emptyRepo = opts . emptyRepo || false
10
9
opts . bits = opts . bits || 2048
11
10
12
11
// Pre-set config values.
13
12
var config = require ( '../../default-config.json' )
14
13
15
- // Verify repo does not yet exist (or that 'force' is provided) .
14
+ // Verify repo does not yet exist.
16
15
repo . exists ( ( err , res ) => {
17
16
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' ) )
20
19
}
21
20
22
21
generateAndSetKeypair ( )
Original file line number Diff line number Diff line change @@ -53,23 +53,4 @@ describe('init', function () {
53
53
} )
54
54
} )
55
55
} )
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
- } )
75
56
} )
You can’t perform that action at this time.
0 commit comments