jsiebens / hashi-up

bootstrap HashiCorp Consul, Nomad, or Vault over SSH < 1 minute
MIT License
676 stars 54 forks source link

Get feature should check if the file already exists before attempting to download overtop #24

Open tylert opened 3 years ago

tylert commented 3 years ago

At the moment, if you run hashi-up foo get it will download the file regardless of whether the binary already exists...

$ sudo hashi-up terraform get --dest /usr/local/bin
Password:
Downloading file https://releases.hashicorp.com/terraform/1.0.3/terraform_1.0.3_darwin_amd64.zip
31.22 MiB / 31.22 MiB [-----------------------------------------------------------------------------------------------------] 100.00%
Extracting file: terraform to /usr/local/bin
$ sudo hashi-up terraform get --dest /usr/local/bin
Downloading file https://releases.hashicorp.com/terraform/1.0.3/terraform_1.0.3_darwin_amd64.zip
31.22 MiB / 31.22 MiB [-----------------------------------------------------------------------------------------------------] 100.00%
Extracting file: terraform to /usr/local/bin
$ sudo hashi-up terraform get --dest /usr/local/bin
Downloading file https://releases.hashicorp.com/terraform/1.0.3/terraform_1.0.3_darwin_amd64.zip
31.22 MiB / 31.22 MiB [-----------------------------------------------------------------------------------------------------] 100.00%
Extracting file: terraform to /usr/local/bin
...

It would be fantastic if hashi-up would display the output of foo version if it finds the binary exists already and perhaps skips downloading if version is already latest (or else it would just halt right away without checking versions on releases.hashicorp.com).

tylert commented 3 years ago

@jsiebens I am very much liking hashi-up for automating creating new build agents. Thanks again.