installation
Installation
Install the latest
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep darwin_amd64_latest \
|grep download \
|head -n 1 \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep linux_amd64_latest \
|grep download \
|head -n 1 \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep windows_amd64_latest \
|grep download \
|head -n 1 \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up
install_latest(){
if [ "$1" == "" ];then
echo "syntax exaple: install_latest darwin | linux | windows"
else
os=$1
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep ${os}_amd64_latest \
|grep download \
|head -n 1 \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up
fi
}
- install for mac:
install_latest darwin
- install for linux:
install_latest linux
- install for windows:
install_latest windows
Install the rolling release
list_rolling(){
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep darwin_amd64_rolling \
|grep download \
|awk '{print $2}' |cut -d \- -f2|cut -d \/ -f1
}
download_rolling(){
if [ "$1" == "" ];then
echo "syntax exaple: download_rolling 20200814"
else
ver=$1
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep darwin_amd64_rolling \
|grep download \
|grep $ver \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up
fi
}
list_rolling
download_rolling 20200814
Install the latest tagged release
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep darwin_amd64_v \
|grep download \
|head -n 1 \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep linux_amd64_v \
|grep download \
|head -n 1 \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up
curl -s https://api.github.com/repos/upcmd/up/releases \
|grep windows_amd64_v \
|grep download \
|head -n 1 \
|awk '{print $2}' \
|xargs -I % curl -L % -o up \
&& chmod +x up