Skip to content

Commit

Permalink
refactor(get): directly addding install.sh to index.html to avoid red…
Browse files Browse the repository at this point in the history
…irect
  • Loading branch information
deimosfr committed Dec 24, 2019
1 parent 7ff033b commit 4a3e93f
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="refresh" content="0; url=https://raw.githubusercontent.com/Qovery/qovery-cli/master/install.sh" />
<title>redirect</title>
<meta name="robots" content="noindex,follow" />
</head>
</html>
#!/usr/bin/env bash

set -e
#set -x

repo="Qovery/qovery-cli"
output_tgz="/tmp/qovery.tgz"
dest_binary="/usr/local/bin"
os=$(uname | tr '[:upper:]' '[:lower:]')

echo "Downloading Qovery CLI archive..."

latest_tag=$(curl --silent "https://api.github.com/repos/$repo/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
version=$(echo $latest_tag | sed 's/^v//')

curl -o $output_tgz -sOL "https://github.com/${repo}/releases/download/${latest_tag}/qovery-cli_${version}_${os}_amd64.tar.gz"

echo "Uncompressing qovery binary in $dest_binary directory"
tar -xzf $output_tgz -C $dest_binary
rm -f $output_tgz

echo -e "\nQovery CLI is installed, you can now use 'qovery' command line"

0 comments on commit 4a3e93f

Please sign in to comment.