Skip to content

Commit

Permalink
Merge pull request #71 from tylerslaton/fix-issue-with-download
Browse files Browse the repository at this point in the history
fix: address issue with override param
  • Loading branch information
ibuildthecloud authored Feb 23, 2024
2 parents fa31314 + 27341f8 commit dd0c7e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/builtin/builtin.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func SysDownload(ctx context.Context, env []string, input string) (_ string, err
var params struct {
URL string `json:"url,omitempty"`
Location string `json:"location,omitempty"`
Override bool `json:"override,omitempty"`
Override string `json:"override,omitempty"`
}
if err := json.Unmarshal([]byte(input), &params); err != nil {
return "", err
Expand All @@ -405,7 +405,7 @@ func SysDownload(ctx context.Context, env []string, input string) (_ string, err
params.Location = f.Name()
}

if checkExists && !params.Override {
if checkExists && params.Override != "true" {
if _, err := os.Stat(params.Location); err == nil {
return "", fmt.Errorf("file %s already exists and can not be overwritten", params.Location)
} else if err != nil && !errors.Is(err, fs.ErrNotExist) {
Expand Down

0 comments on commit dd0c7e9

Please sign in to comment.