File tree 4 files changed +7
-7
lines changed
4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ var commandsClientCmd = commands.CommandsCmd(Root)
23
23
var localCommands = map [string ]* cmds.Command {
24
24
"daemon" : daemonCmd ,
25
25
"init" : initCmd ,
26
- "tour" : tourCmd ,
27
26
"commands" : commandsClientCmd ,
28
27
}
29
28
var localMap = make (map [* cmds.Command ]bool )
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ var rootSubcommands = map[string]*cmds.Command{
101
101
"resolve" : ResolveCmd ,
102
102
"stats" : StatsCmd ,
103
103
"swarm" : SwarmCmd ,
104
+ "tour" : tourCmd ,
104
105
"update" : UpdateCmd ,
105
106
"version" : VersionCmd ,
106
107
"bitswap" : BitswapCmd ,
Original file line number Diff line number Diff line change 1
- package main
1
+ package commands
2
2
3
3
import (
4
4
"bytes"
5
5
"fmt"
6
6
"html/template"
7
7
"io"
8
- "os"
9
8
10
9
cmds "github.com/ipfs/go-ipfs/commands"
11
10
config "github.com/ipfs/go-ipfs/repo/config"
@@ -50,7 +49,6 @@ func tourRunFunc(req cmds.Request, res cmds.Response) {
50
49
}
51
50
52
51
var w bytes.Buffer
53
- defer w .WriteTo (os .Stdout )
54
52
t , err := tourGet (id )
55
53
if err != nil {
56
54
@@ -64,11 +62,13 @@ func tourRunFunc(req cmds.Request, res cmds.Response) {
64
62
fmt .Fprintln (& w , err )
65
63
fmt .Fprintln (& w , "" )
66
64
fprintTourList (& w , tour .TopicID (cfg .Tour .Last ))
65
+ res .SetOutput (bytes .NewReader (w .Bytes ()))
67
66
68
67
return
69
68
}
70
69
71
70
fprintTourShow (& w , t )
71
+ res .SetOutput (bytes .NewReader (w .Bytes ()))
72
72
}
73
73
74
74
var cmdIpfsTourNext = & cmds.Command {
@@ -106,7 +106,7 @@ var cmdIpfsTourNext = &cmds.Command{
106
106
}
107
107
}
108
108
109
- w . WriteTo ( os . Stdout )
109
+ res . SetOutput ( bytes . NewReader ( w . Bytes ()) )
110
110
},
111
111
}
112
112
@@ -146,7 +146,7 @@ var cmdIpfsTourList = &cmds.Command{
146
146
147
147
var w bytes.Buffer
148
148
fprintTourList (& w , tour .TopicID (cfg .Tour .Last ))
149
- w . WriteTo ( os . Stdout )
149
+ res . SetOutput ( bytes . NewReader ( w . Bytes ()) )
150
150
},
151
151
}
152
152
Original file line number Diff line number Diff line change 1
- package main
1
+ package commands
2
2
3
3
import (
4
4
"bytes"
You can’t perform that action at this time.
0 commit comments