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
7d53e736
Commit
7d53e736
authored
Oct 27, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/ipfs: Added getConfig function
parent
cf60fdd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
+10
-7
cmd/ipfs/daemon.go
cmd/ipfs/daemon.go
+1
-7
cmd/ipfs/ipfs.go
cmd/ipfs/ipfs.go
+9
-0
No files found.
cmd/ipfs/daemon.go
View file @
7d53e736
...
...
@@ -43,13 +43,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
}
defer
lk
.
Close
()
configFile
,
err
:=
config
.
Filename
(
configPath
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
}
config
,
err
:=
config
.
Load
(
configFile
)
config
,
err
:=
getConfig
(
configPath
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrNormal
)
return
...
...
cmd/ipfs/ipfs.go
View file @
7d53e736
...
...
@@ -149,3 +149,12 @@ func getConfigPath(req cmds.Request) (string, error) {
}
return
configPath
,
nil
}
func
getConfig
(
path
string
)
(
*
config
.
Config
,
error
)
{
configFile
,
err
:=
config
.
Filename
(
path
)
if
err
!=
nil
{
return
nil
,
err
}
return
config
.
Load
(
configFile
)
}
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