MCPcopy Create free account
hub / github.com/OverloadBlitz/cloudcent-cli / prependPythonPath

Function prependPythonPath

cmd/pulumi.go:1245–1257  ·  view source on GitHub ↗

prependPythonPath returns a copy of env with the given directory prepended to PYTHONPATH.

(env []string, dir string)

Source from the content-addressed store, hash-verified

1243
1244// prependPythonPath returns a copy of env with the given directory prepended to PYTHONPATH.
1245func prependPythonPath(env []string, dir string) []string {
1246 const prefix = "PYTHONPATH="
1247 result := make([]string, len(env))
1248 copy(result, env)
1249 for i, e := range result {
1250 if strings.HasPrefix(e, prefix) {
1251 result[i] = prefix + dir + string(os.PathListSeparator) + e[len(prefix):]
1252 return result
1253 }
1254 }
1255 result = append(result, prefix+dir)
1256 return result
1257}
1258
1259// reMissingConfig matches Pulumi's "Missing required configuration variable 'ns:key'" message.
1260var reMissingConfig = regexp.MustCompile(`Missing required configuration variable '([^']+)'`)

Callers 1

runUserProgramToFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected