Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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