Skip to content

Commit 40c6ffd

Browse files
committedJun 19, 2015
core/commands: Make IpnsCmd and PublishCmd public
ipfs-shell [1] accesses the Command objects directly to construct requests for an external IPFS daemon API. This isn't a terribly robust approach, because it doesn't handle version differences between the version of go-ipfs used to build the daemon and the version used to build the ipfs-shell-consuming application. But for cases where you can get those APIs to match it works well. Making these two commands public allows us to write ipfs-shell wrappers for them. Until we figure out how to get ipfs-shell working without access to core/commands, I think the best approach is to make future command objects and their returned structures public, and to go back and expose existing commands/structures on an as-needed basis. In this case, I need the public PublishCmd for the Docker-registry storage driver, and I made the IpnsCmd public at the same time to stay consistent for both 'ipfs name ...' sub-commands. [1]: https://github.com/whyrusleeping/ipfs-shell License: MIT Signed-off-by: W. Trevor King <wking@tremily.us>
1 parent 848502d commit 40c6ffd

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed
 

‎core/commands/ipns.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
u "github.com/ipfs/go-ipfs/util"
1111
)
1212

13-
var ipnsCmd = &cmds.Command{
13+
var IpnsCmd = &cmds.Command{
1414
Helptext: cmds.HelpText{
1515
Tagline: "Gets the value currently published at an IPNS name",
1616
ShortDescription: `

‎core/commands/name.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Resolve the value of another name:
5151
},
5252

5353
Subcommands: map[string]*cmds.Command{
54-
"publish": publishCmd,
55-
"resolve": ipnsCmd,
54+
"publish": PublishCmd,
55+
"resolve": IpnsCmd,
5656
},
5757
}

‎core/commands/publish.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
var errNotOnline = errors.New("This command must be run in online mode. Try running 'ipfs daemon' first.")
1919

20-
var publishCmd = &cmds.Command{
20+
var PublishCmd = &cmds.Command{
2121
Helptext: cmds.HelpText{
2222
Tagline: "Publish an object to IPNS",
2323
ShortDescription: `

0 commit comments

Comments
 (0)
Please sign in to comment.