MCPcopy
hub / github.com/filebrowser/filebrowser / ParseCommand

Function ParseCommand

runner/parser.go:10–25  ·  view source on GitHub ↗

ParseCommand parses the command taking in account if the current instance uses a shell to run the commands or just calls the binary directly.

(s *settings.Settings, raw string)

Source from the content-addressed store, hash-verified

8// instance uses a shell to run the commands or just calls the binary
9// directly.
10func ParseCommand(s *settings.Settings, raw string) (command []string, name string, err error) {
11 name, args, err := SplitCommandAndArgs(raw)
12 if err != nil {
13 return
14 }
15
16 if len(s.Shell) == 0 || s.Shell[0] == "" {
17 command = append(command, name)
18 command = append(command, args...)
19 } else {
20 command = append(command, s.Shell...)
21 command = append(command, raw)
22 }
23
24 return command, name, nil
25}

Callers 2

commands.goFile · 0.92
execMethod · 0.85

Calls 1

SplitCommandAndArgsFunction · 0.85

Tested by

no test coverage detected