[bin] Add fzf and upgrade Packer

This commit is contained in:
Sebastian Schulze 2019-03-07 11:28:20 +01:00
parent 445acdeff8
commit 4a88a96179
Signed by: bascht
GPG Key ID: 5BCB1D3B4D38A35A
1 changed files with 8 additions and 1 deletions

View File

@ -52,7 +52,7 @@ binaries = {
},
packer: {
url: "https://releases.hashicorp.com/packer/<%= version %>/packer_<%= version %>_linux_amd64.zip",
version: "1.3.4",
version: "1.3.5",
version_argument: "version",
version_match: "^Packer v<%= version %>"
},
@ -74,6 +74,12 @@ binaries = {
version_argument: "version -c",
version_match: "v<%= version %>"
},
fzf: {
url: "https://github.com/junegunn/fzf-bin/releases/download/<%= version %>/fzf-<%= version %>-linux_amd64.tgz",
version: "0.17.5",
version_argument: "--version",
version_match: "v<%= version %>"
},
}
tmpdir = Dir.mktmpdir
@ -99,6 +105,7 @@ binaries.each do |binary, download|
system "curl -s -L -O #{download_url}"
downloaded_file = Dir.glob("*").first
system("tar xvf #{downloaded_file} > /dev/null") if downloaded_file.end_with?(".tgz")
system("tar xvf #{downloaded_file} > /dev/null") if downloaded_file.end_with?(".gz")
system("unzip #{downloaded_file} > /dev/null") if downloaded_file.end_with?(".zip")
FileUtils.mv(File.realpath([Dir.glob("#{binary}-*/#{binary}*"), Dir.glob("**/**/#{binary}*"), binary].flatten.first), target)