Skip to content

Commit

Permalink
Merge pull request #181 from smacker/always_update_env_on_init
Browse files Browse the repository at this point in the history
Update .env file on init always
  • Loading branch information
smacker authored Aug 2, 2019
2 parents 912decc + b77ffb9 commit eff2ca7
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions cmd/sourced/compose/workdir/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,17 +343,10 @@ func initWorkdir(workdirPath string, envFile envFile) error {
}

envPath := filepath.Join(workdirPath, ".env")
emptyFile, err := isEmptyFile(envPath)
contents := envFile.String()
err = ioutil.WriteFile(envPath, []byte(contents), 0644)
if err != nil {
return errors.Wrap(err, "could not read .env file contents")
}

if emptyFile {
contents := envFile.String()
err = ioutil.WriteFile(envPath, []byte(contents), 0644)
if err != nil {
return errors.Wrap(err, "could not write .env file")
}
return errors.Wrap(err, "could not write .env file")
}

return nil
Expand Down

0 comments on commit eff2ca7

Please sign in to comment.