mirror of https://github.com/databricks/cli.git
rm InsertPathEntry; use os.PathListSeparator
This commit is contained in:
parent
dcfeeacea2
commit
5b4c7624fe
|
@ -61,25 +61,3 @@ func Chdir(t TestingT, dir string) string {
|
|||
|
||||
return wd
|
||||
}
|
||||
|
||||
func InsertPathEntry(t TestingT, path string) {
|
||||
var separator string
|
||||
if runtime.GOOS == "windows" {
|
||||
separator = ";"
|
||||
} else {
|
||||
separator = ":"
|
||||
}
|
||||
|
||||
t.Setenv("PATH", path+separator+os.Getenv("PATH"))
|
||||
}
|
||||
|
||||
func InsertVirtualenvInPath(t TestingT, venvPath string) {
|
||||
if runtime.GOOS == "windows" {
|
||||
// https://github.com/pypa/virtualenv/commit/993ba1316a83b760370f5a3872b3f5ef4dd904c1
|
||||
venvPath = filepath.Join(venvPath, "Scripts")
|
||||
} else {
|
||||
venvPath = filepath.Join(venvPath, "bin")
|
||||
}
|
||||
|
||||
InsertPathEntry(t, venvPath)
|
||||
}
|
||||
|
|
|
@ -106,7 +106,8 @@ func RequireActivatedPythonEnv(t *testing.T, ctx context.Context, opts *VenvOpts
|
|||
require.NoError(t, err)
|
||||
require.DirExists(t, opts.BinPath)
|
||||
|
||||
testutil.InsertPathEntry(t, opts.BinPath)
|
||||
newPath := fmt.Sprintf("%s%c%s", opts.BinPath, os.PathListSeparator, os.Getenv("PATH"))
|
||||
t.Setenv("PATH", newPath)
|
||||
|
||||
pythonExe, err := python.DetectExecutable(ctx)
|
||||
require.NoError(t, err)
|
||||
|
|
Loading…
Reference in New Issue