diff --git a/cmd/micro/shell.go b/cmd/micro/shell.go index 94ed9569..88a8c656 100644 --- a/cmd/micro/shell.go +++ b/cmd/micro/shell.go @@ -65,10 +65,10 @@ func RunBackgroundShell(input string) { }() } -func RunInteractiveShell(input string, wait bool, getOutput bool) string { +func RunInteractiveShell(input string, wait bool, getOutput bool) (string, error) { args, err := shellwords.Split(input) if err != nil { - return "" + return "", err } inputCmd := args[0] @@ -103,9 +103,6 @@ func RunInteractiveShell(input string, wait bool, getOutput bool) string { err = cmd.Wait() output := outputBytes.String() - if err != nil { - output = err.Error() - } if wait { // This is just so we don't return right away and let the user press enter to return @@ -115,7 +112,7 @@ func RunInteractiveShell(input string, wait bool, getOutput bool) string { // Start the screen back up InitScreen() - return output + return output, err } // HandleShellCommand runs the shell command diff --git a/cmd/micro/shell_posix.go b/cmd/micro/shell_supported.go similarity index 84% rename from cmd/micro/shell_posix.go rename to cmd/micro/shell_supported.go index b2176150..2bf5fd92 100644 --- a/cmd/micro/shell_posix.go +++ b/cmd/micro/shell_supported.go @@ -1,4 +1,4 @@ -// +build linux darwin dragonfly solaris openbsd netbsd freebsd +// +build linux darwin dragonfly openbsd freebsd package main diff --git a/cmd/micro/shell_windows.go b/cmd/micro/shell_unsupported.go similarity index 77% rename from cmd/micro/shell_windows.go rename to cmd/micro/shell_unsupported.go index 4db86873..006c9ee0 100644 --- a/cmd/micro/shell_windows.go +++ b/cmd/micro/shell_unsupported.go @@ -1,4 +1,4 @@ -// +build plan9 nacl windows +// +build !linux,!darwin,!freebsd,!dragonfly,!openbsd package main