ParseGeneratorScript 解析generator脚本
(script string)
| 56 | |
| 57 | // ParseGeneratorScript 解析generator脚本 |
| 58 | func ParseGeneratorScript(script string) (string, []string, error) { |
| 59 | vals := strings.Split(script, " ") |
| 60 | if len(vals) <= 1 { |
| 61 | return "", nil, errors.Errorf("generator calling script error") |
| 62 | } |
| 63 | return vals[0], vals[1:], nil |
| 64 | } |
| 65 | |
| 66 | // RunUnixShell 运行UnixShell,支持context |
| 67 | func RunUnixShell(options *structs.ShellOptions) (*structs.ShellResult, error) { |