bolt
bolt copied to clipboard
`download_file` shouldn't be destructive
Describe the Bug
The built-in download_file function is destructive and will remove existing files of the destination directory. This is a problem when trying to download multiple files from a target that would result in calling download_file twice.
This might not be considered a bug, but it is definitely undesirable behavior from my point of view.
Expected Behavior
Stop removing files. Overwrite behavior is probably fine, but I can imagine situations where that wouldn't be desirable. Perhaps this could be a config option.
Steps to Reproduce
Steps to reproduce the behavior: From a single plan perform the following actions:
- Call
download_file('/src/foo.txt', 'foo.txt', $target) - Call
download_file('/src/bar.txt', 'bar.txt', $target) - Inspect
downloads/<target>to see that foo.txt has been deleted.
Environment
- Version 3.26.1
- Platform Ubuntu 20.04