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
af65eec2
Commit
af65eec2
authored
10 years ago
by
Matt Bell
Committed by
Juan Batiz-Benet
10 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands2: Output error when trying to run 'publish' or 'resolve' in offline mode
parent
51c6a1c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
core/commands2/name.go
core/commands2/name.go
+12
-0
No files found.
core/commands2/name.go
View file @
af65eec2
...
...
@@ -20,6 +20,8 @@ type ResolveOutput struct {
Entries
[]
IpnsEntry
}
var
errNotOnline
=
errors
.
New
(
"This command must be run in online mode. Try running 'ipfs daemon' first."
)
var
nameCmd
=
&
cmds
.
Command
{
Help
:
"TODO"
,
Subcommands
:
map
[
string
]
*
cmds
.
Command
{
...
...
@@ -38,6 +40,11 @@ var publishCmd = &cmds.Command{
n
:=
req
.
Context
()
.
Node
args
:=
req
.
Arguments
()
if
n
.
Network
==
nil
{
res
.
SetError
(
errNotOnline
,
cmds
.
ErrNormal
)
return
}
if
n
.
Identity
==
nil
{
res
.
SetError
(
errors
.
New
(
"Identity not loaded!"
),
cmds
.
ErrNormal
)
return
...
...
@@ -86,6 +93,11 @@ var resolveCmd = &cmds.Command{
n
:=
req
.
Context
()
.
Node
var
names
[]
string
if
n
.
Network
==
nil
{
res
.
SetError
(
errNotOnline
,
cmds
.
ErrNormal
)
return
}
if
len
(
req
.
Arguments
())
==
0
{
if
n
.
Identity
==
nil
{
res
.
SetError
(
errors
.
New
(
"Identity not loaded!"
),
cmds
.
ErrNormal
)
...
...
This diff is collapsed.
Click to expand it.
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