diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index 0faa49560..7e0eaacb0 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -78,10 +78,6 @@ environment variable: }, Run: func(req *cmds.Request, res cmds.ResponseEmitter, env cmds.Environment) error { cctx := env.(*oldcmds.Context) - if cctx.Online { - return cmdkit.Error{Message: "init must be run offline only"} - } - empty, _ := req.Options[emptyRepoOptionName].(bool) nBitsForKeypair, _ := req.Options[bitsOptionName].(int) diff --git a/cmd/ipfswatch/main.go b/cmd/ipfswatch/main.go index ab93cc2c6..8185cdf3f 100644 --- a/cmd/ipfswatch/main.go +++ b/cmd/ipfswatch/main.go @@ -207,7 +207,6 @@ func IsHidden(path string) bool { func cmdCtx(node *core.IpfsNode, repoPath string) commands.Context { return commands.Context{ - Online: true, ConfigRoot: repoPath, LoadConfig: func(path string) (*config.Config, error) { return node.Repo.Config() diff --git a/commands/context.go b/commands/context.go index 9b8d08f1f..f747166e1 100644 --- a/commands/context.go +++ b/commands/context.go @@ -21,7 +21,6 @@ var log = logging.Logger("command") // Context represents request context type Context struct { - Online bool ConfigRoot string ReqLog *ReqLog diff --git a/core/commands/external.go b/core/commands/external.go index 2217dfa7b..d8ca31f29 100644 --- a/core/commands/external.go +++ b/core/commands/external.go @@ -8,8 +8,6 @@ import ( "os/exec" "strings" - commands "github.com/ipfs/go-ipfs/commands" - cmds "gx/ipfs/QmQkW9fnCsg9SLHdViiAh6qfBppodsPZVpU92dZLqYtEfs/go-ipfs-cmds" cmdkit "gx/ipfs/Qmde5VP1qUkyQXKCfmEUA7bP64V2HAptbJ7phuPp7jXWwg/go-ipfs-cmdkit" ) @@ -51,15 +49,6 @@ func ExternalBinary() *cmds.Command { // setup env of child program osenv := os.Environ() - // Get the node iff already defined. - if cctx, ok := env.(*commands.Context); ok && cctx.Online { - nd, err := cctx.GetNode() - if err != nil { - return fmt.Errorf("failed to start ipfs node: %s", err) - } - osenv = append(osenv, fmt.Sprintf("IPFS_ONLINE=%t", nd.OnlineMode())) - } - cmd.Env = osenv err = cmd.Start() diff --git a/core/mock/mock.go b/core/mock/mock.go index 539d78b75..91a838d70 100644 --- a/core/mock/mock.go +++ b/core/mock/mock.go @@ -62,7 +62,6 @@ func MockCmdsCtx() (commands.Context, error) { } return commands.Context{ - Online: true, ConfigRoot: "/tmp/.mockipfsconfig", LoadConfig: func(path string) (*config.Config, error) { return &conf, nil