Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
a2d1e339
Commit
a2d1e339
authored
Jan 12, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(init): write config at top level
parent
44f3d95c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
cmd/ipfs/init.go
cmd/ipfs/init.go
+6
-6
No files found.
cmd/ipfs/init.go
View file @
a2d1e339
...
@@ -104,11 +104,15 @@ func doInit(configRoot string, dspathOverride string, force bool, nBitsForKeypai
...
@@ -104,11 +104,15 @@ func doInit(configRoot string, dspathOverride string, force bool, nBitsForKeypai
return
nil
,
errCannotInitConfigExists
return
nil
,
errCannotInitConfigExists
}
}
conf
,
err
:=
initConfig
(
configFilename
,
dspathOverride
,
nBitsForKeypair
)
conf
,
err
:=
initConfig
(
dspathOverride
,
nBitsForKeypair
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
if
err
:=
config
.
WriteConfigFile
(
configFilename
,
conf
);
err
!=
nil
{
return
nil
,
err
}
err
=
addTheWelcomeFile
(
conf
)
err
=
addTheWelcomeFile
(
conf
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -165,7 +169,7 @@ func datastoreConfig(dspath string) (config.Datastore, error) {
...
@@ -165,7 +169,7 @@ func datastoreConfig(dspath string) (config.Datastore, error) {
return
ds
,
nil
return
ds
,
nil
}
}
func
initConfig
(
configFilename
string
,
dspathOverride
string
,
nBitsForKeypair
int
)
(
*
config
.
Config
,
error
)
{
func
initConfig
(
dspathOverride
string
,
nBitsForKeypair
int
)
(
*
config
.
Config
,
error
)
{
ds
,
err
:=
datastoreConfig
(
dspathOverride
)
ds
,
err
:=
datastoreConfig
(
dspathOverride
)
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
...
@@ -214,10 +218,6 @@ func initConfig(configFilename string, dspathOverride string, nBitsForKeypair in
...
@@ -214,10 +218,6 @@ func initConfig(configFilename string, dspathOverride string, nBitsForKeypair in
Version
:
config
.
VersionDefaultValue
(),
Version
:
config
.
VersionDefaultValue
(),
}
}
if
err
:=
config
.
WriteConfigFile
(
configFilename
,
conf
);
err
!=
nil
{
return
nil
,
err
}
return
conf
,
nil
return
conf
,
nil
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment