Skip to content

Commit

Permalink
(#25) Fix compose down
Browse files Browse the repository at this point in the history
We need to add compose-specific environment variables for identifier
and compose file path
  • Loading branch information
mdelapenya committed Sep 18, 2019
1 parent 94069c6 commit 501c6a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ func (dc *LocalDockerCompose) Down() ExecError {
panic("Local Docker Compose not found. Is " + dc.Executable + " on the PATH?")
}

environment := map[string]string{
envProjectName: dc.Identifier,
envComposeFile: dc.ComposeFilePath,
}

abs, err := filepath.Abs(dc.ComposeFilePath)
pwd, name := filepath.Split(abs)

cmds := []string{
"-f", name, "down",
}

execErr := execute(pwd, map[string]string{}, dc.Executable, cmds)
execErr := execute(pwd, environment, dc.Executable, cmds)
err = execErr.Error
if err != nil {
args := strings.Join(dc.Cmd, " ")
Expand Down

0 comments on commit 501c6a0

Please sign in to comment.