mirror of
https://github.com/docker/compose.git
synced 2025-07-24 06:04:57 +02:00
Fix windows PATH for e2e tests
This commit is contained in:
parent
6bfdded047
commit
5258906ce3
@ -91,10 +91,17 @@ func (s *Suite) copyExecutablesInBinDir() {
|
|||||||
gomega.Expect(err).To(gomega.BeNil())
|
gomega.Expect(err).To(gomega.BeNil())
|
||||||
err = copyFile(dockerPath, filepath.Join(s.BinDir, dockerExecutable()))
|
err = copyFile(dockerPath, filepath.Join(s.BinDir, dockerExecutable()))
|
||||||
gomega.Expect(err).To(gomega.BeNil())
|
gomega.Expect(err).To(gomega.BeNil())
|
||||||
err = os.Setenv("PATH", fmt.Sprintf("%s:%s", s.BinDir, os.Getenv("PATH")))
|
err = os.Setenv("PATH", concatenatePath(s.BinDir))
|
||||||
gomega.Expect(err).To(gomega.BeNil())
|
gomega.Expect(err).To(gomega.BeNil())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func concatenatePath(path string) string {
|
||||||
|
if IsWindows() {
|
||||||
|
return fmt.Sprintf("%s;%s", path, os.Getenv("PATH"))
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%s:%s", path, os.Getenv("PATH"))
|
||||||
|
}
|
||||||
|
|
||||||
func copyFile(sourceFile string, destinationFile string) error {
|
func copyFile(sourceFile string, destinationFile string) error {
|
||||||
input, err := ioutil.ReadFile(sourceFile)
|
input, err := ioutil.ReadFile(sourceFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user