Skip to content

fix: address issue with override param #71

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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