mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-17 06:17:12 +09:00
@@ -2,6 +2,7 @@ package shell
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@@ -36,6 +37,9 @@ func RunCommand(input string) (string, error) {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(args) == 0 {
|
||||
return "", errors.New("No arguments")
|
||||
}
|
||||
inputCmd := args[0]
|
||||
|
||||
return ExecCommand(inputCmd, args[1:]...)
|
||||
@@ -49,6 +53,9 @@ func RunBackgroundShell(input string) (func() string, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(args) == 0 {
|
||||
return nil, errors.New("No arguments")
|
||||
}
|
||||
inputCmd := args[0]
|
||||
return func() string {
|
||||
output, err := RunCommand(input)
|
||||
@@ -72,6 +79,9 @@ func RunInteractiveShell(input string, wait bool, getOutput bool) (string, error
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
if len(args) == 0 {
|
||||
return "", errors.New("No arguments")
|
||||
}
|
||||
inputCmd := args[0]
|
||||
|
||||
// Shut down the screen because we're going to interact directly with the shell
|
||||
|
||||
Reference in New Issue
Block a user