@cryptotaxi247 / kubo / commits / c312cfff2

feat: add install instructions for external commands

Issue reported on IRC.

Steven Allen committed Jul 26, 2019 at 12:37 UTC c312cfff27c9162b1486e2c7e3cbfdfc6273c000
2 files changed +3 -3
core/commands/external.go
+2 -2
@@ -11,7 +11,7 @@ import (
11 cmds "github.com/ipfs/go-ipfs-cmds"
12 )
13
14 -func ExternalBinary() *cmds.Command {
14 +func ExternalBinary(instructions string) *cmds.Command {
15 return &cmds.Command{
16 Arguments: []cmds.Argument{
17 cmds.StringArg("args", false, true, "Arguments for subcommand."),
@@ -27,7 +27,7 @@ func ExternalBinary() *cmds.Command {
27 buf := new(bytes.Buffer)
28 fmt.Fprintf(buf, "%s is an 'external' command.\n", binname)
29 fmt.Fprintf(buf, "It does not currently appear to be installed.\n")
30 - fmt.Fprintf(buf, "Please refer to the ipfs documentation for instructions.\n")
30 + fmt.Fprintf(buf, "%s\n", instructions)
31 return res.Emit(buf)
32 }
33 }
core/commands/root.go
+1 -1
@@ -144,7 +144,7 @@ var rootSubcommands = map[string]*cmds.Command{
144 "swarm": SwarmCmd,
145 "tar": TarCmd,
146 "file": unixfs.UnixFSCmd,
147 - "update": ExternalBinary(),
147 + "update": ExternalBinary("Please see https://git.io/fjylH for installation instructions."),
148 "urlstore": urlStoreCmd,
149 "version": VersionCmd,
150 "shutdown": daemonShutdownCmd,