forked from ali77gh/shecan-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·40 lines (32 loc) · 856 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
#!/bin/bash
platform=`uname`
if [ "$platform" = "Linux" ]
then
install_path="/usr/bin/shecan-cli"
fi
if [ "$platform" = "Darwin" ]
then
install_path="/usr/local/bin/shecan-cli"
fi
# download
echo "downloading..."
repo="ali77gh/shecan-cli"
tag_name=$(curl --silent https://api.github.com/repos/$repo/releases/latest \
| grep '"tag_name"' \
| sed --regexp-extended 's/.*"([^"]+)".*/\1/')
curl -sfL "https://github.com/$repo/releases/download/$tag_name/shecan.py" --output temp.py
echo "done"
# copy
echo "installing..."
mv temp.py "$install_path"
echo "done"
# access
echo "making script executable..."
chmod +x "$install_path"
echo "done"
echo "shecan-cli installed successfully"
# install requests
echo "installing requests module"
sudo pip install requests
echo "installed successfully"
shecan-cli help