Rex
Rex copied to clipboard
Implement fetch command
It would be nice to provide a way to download files on the remote machine (in contrast to the currently implemented download command, that is downloading a file from the remote machine to the local machine).
I would call this command fetch for now.
Just dumping all the ideas here:
- check if
File::Fetchis available in the remote machine, and if yes, use that - otherwise check for curl and wget
- ideally only download the file if it's not already downloaded
- ideally it can resume an aborted download
- if there is md5/sha checksum file available at the source location, try to download them and check the downloaded content against them
- if keys are provided and gpg is available on the remote machine, try to also look for signature files, and verify them as well
- return the full absolute path of the downloaded file upon success
- throws exceptions otherwise
The main points are:
- easy downloads on the remote machine
- verify downloaded content
- do it smartly (don't download twice, resume aborted download)
I would probably hack on this soon-ish, but feel free to beat me to it if you already have something like this implemented locally.