2
0
mirror of https://github.com/miguelmota/cointop synced 2024-11-10 13:10:26 +00:00
cointop/install.sh
Santiago Boselli 9576af6b66
Fix version Regex in Binary install script
Previous regex was including the "v" in the query, causing the release links to 404, since the filenames in the releases do not contain the "v".
2020-08-21 19:16:27 -03:00

18 lines
485 B
Bash
Executable File

#!/bin/bash
VERSION=$(curl --silent "https://api.github.com/repos/miguelmota/cointop/releases/latest" | grep -Po --color=never '"tag_name": ".\K.*?(?=")')
OSNAME="linux"
if [[ $(uname) == 'Darwin' ]]; then
OSNAME="darwin"
fi
(
cd /tmp
wget https://github.com/miguelmota/cointop/releases/download/v${VERSION}/cointop_${VERSION}_${OSNAME}_amd64.tar.gz
tar -xvzf cointop_${VERSION}_${OSNAME}_amd64.tar.gz cointop
sudo mv cointop /usr/local/bin/cointop
cointop --version
)