Skip to content

Commit

Permalink
fix: merge build args
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianKramm committed Sep 7, 2023
1 parent 0152950 commit 7113ddf
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,13 @@ func (cmd *BuildCmd) Run() error {
if cmd.Target == "" {
cmd.Target = os.Getenv("DOCKERLESS_TARGET")
}
if len(cmd.BuildArgs) == 0 {
buildArgs := os.Getenv("DOCKERLESS_BUILD_ARGS")
if buildArgs != "" {
_ = json.Unmarshal([]byte(buildArgs), &cmd.BuildArgs)
}

// parse extra build args
buildArgs := os.Getenv("DOCKERLESS_BUILD_ARGS")
if buildArgs != "" {
extraBuildArgs := []string{}
_ = json.Unmarshal([]byte(buildArgs), &extraBuildArgs)
cmd.BuildArgs = append(cmd.BuildArgs, extraBuildArgs...)
}

// start actual build
Expand Down

0 comments on commit 7113ddf

Please sign in to comment.