MCPcopy
hub / github.com/rclone/rclone / rcloneExecMain

Function rcloneExecMain

cmdtest/cmdtest_test.go:47–60  ·  view source on GitHub ↗

rcloneExecMain calls rclone with the given environment and arguments. The environment variables are in a single string separated by ; The terminal output is returned as a string.

(env string, args ...string)

Source from the content-addressed store, hash-verified

45// The environment variables are in a single string separated by ;
46// The terminal output is returned as a string.
47func rcloneExecMain(env string, args ...string) (string, error) {
48 _, found := os.LookupEnv(rcloneTestMain)
49 if !found {
50 fs.Fatalf(nil, "Unexpected execution path: %s is missing.", rcloneTestMain)
51 }
52 // make a call to self to execute rclone main in a predefined environment (enters TestMain above)
53 command := exec.Command(os.Args[0], args...)
54 command.Env = getEnvInitial()
55 if env != "" {
56 command.Env = append(command.Env, strings.Split(env, ";")...)
57 }
58 out, err := command.CombinedOutput()
59 return string(out), err
60}
61
62// rcloneEnv calls rclone with the given environment and arguments.
63// The environment variables are in a single string separated by ;

Callers 1

rcloneEnvFunction · 0.85

Calls 3

FatalfFunction · 0.92
getEnvInitialFunction · 0.85
CommandMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…