forked from Mikubill/cowtransfer-uploader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
42 lines (36 loc) · 754 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -e
hash tar uname grep curl head
OS="`uname`"
case $OS in
Linux)
OS='linux'
;;
FreeBSD)
OS='freebsd'
;;
Darwin)
OS='darwin'
;;
*)
echo 'OS not supported'
exit 2
;;
esac
ARCH="`uname -m`"
case $ARCH in
x86_64|amd64)
ARCH='amd64'
;;
aarch64)
ARCH='arm64'
;;
*)
echo 'OS type not supported'
exit 2
;;
esac
VERSION=$(curl -s https://api.github.com/repos/Mikubill/cowtransfer-uploader/releases/latest 2>&1 | grep -Po '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
curl -sL https://github.com/Mikubill/cowtransfer-uploader/releases/download/v$VERSION/cowtransfer-uploader_$VERSION\_$OS\_$ARCH.tar.gz | tar xz
printf "\nCowTransfer-uploader Downloded.\n\n"
exit 0