diff --git a/source/build.go b/source/build.go index efab7d4..b8dc3a6 100644 --- a/source/build.go +++ b/source/build.go @@ -30,8 +30,14 @@ func ParseBuildScript(str string) (BuildScript, error) { continue } parts := strings.Split(line, " ") - if _, err := exec.LookPath(parts[0]); err != nil { - return nil, fmt.Errorf("line %d: %w", i, err) + for _, part := range parts { + if strings.Contains(part, "=") { + continue + } + if _, err := exec.LookPath(part); err != nil { + return nil, fmt.Errorf("line %d: %w", i, err) + } + break } out = append(out, BuildStep(line)) } diff --git a/source/build_test.go b/source/build_test.go index e176e2c..04dc5c9 100644 --- a/source/build_test.go +++ b/source/build_test.go @@ -54,6 +54,13 @@ func TestParseBuildScript(t *testing.T) { input: "thisfiledoesnotexist --xx --yy", wantErr: true, }, + { + name: "EnvVar", + input: "FOO=bar echo $FOO", + want: BuildScript{ + "FOO=bar echo $FOO", + }, + }, { name: "Empty", input: "",