Merge pull request #15 from glours/find_existing_docker_binary

Use docker binary find in path to fallback to Moby CLI
This commit is contained in:
Djordje Lukic 2020-04-23 11:32:13 +02:00 committed by GitHub
commit 29a838ddf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -49,7 +49,7 @@ func init() {
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
if err := os.Setenv("PATH", fmt.Sprintf("$PATH:%s", path)); err != nil { if err := os.Setenv("PATH", fmt.Sprintf("%s:%s", os.Getenv("PATH"),path)); err != nil {
panic(err) panic(err)
} }
} }
@ -115,7 +115,7 @@ func main() {
} }
func shellOutToDefaultEngine() { func shellOutToDefaultEngine() {
cmd := exec.Command("/Applications/Docker.app/Contents/Resources/bin/docker", os.Args[1:]...) cmd := exec.Command("docker", os.Args[1:]...)
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr cmd.Stderr = os.Stderr