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-dms3
Commits
a1e738e2
Commit
a1e738e2
authored
Nov 04, 2014
by
Brian Tiger Chow
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs(init) rename filename var
parent
8d7ebcb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
cmd/ipfs2/init.go
cmd/ipfs2/init.go
+5
-4
No files found.
cmd/ipfs2/init.go
View file @
a1e738e2
...
...
@@ -62,12 +62,13 @@ var initCmd = &cmds.Command{
func
doInit
(
configRoot
string
,
dspath
string
,
force
bool
,
nBitsForKeypair
int
)
error
{
u
.
POut
(
"initializing ipfs node at %s
\n
"
,
configRoot
)
filename
,
err
:=
config
.
Filename
(
configRoot
)
configFilename
,
err
:=
config
.
Filename
(
configRoot
)
if
err
!=
nil
{
return
errors
.
New
(
"Couldn't get home directory path"
)
}
fi
,
err
:=
os
.
Lstat
(
f
ilename
)
fi
,
err
:=
os
.
Lstat
(
configF
ilename
)
if
fi
!=
nil
||
(
err
!=
nil
&&
!
os
.
IsNotExist
(
err
))
{
if
!
force
{
// TODO multi-line string
...
...
@@ -112,7 +113,7 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
IPNS
:
"/ipns"
,
}
// TODO guard
// TODO guard
higher up
if
nBitsForKeypair
<
1024
{
return
errors
.
New
(
"Bitsize less than 1024 is considered unsafe."
)
}
...
...
@@ -152,7 +153,7 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
Current
:
updates
.
Version
,
}
err
=
config
.
WriteConfigFile
(
f
ilename
,
cfg
)
err
=
config
.
WriteConfigFile
(
configF
ilename
,
cfg
)
if
err
!=
nil
{
return
err
}
...
...
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