-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
62 lines (49 loc) · 1.23 KB
/
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env sh
#
# This is an script for install inhere/kite
# More please see https://github.com/inhere/kite
#
# local run: bash ./deploy/install.sh
set -e
INSTALL_DIR=~
CLONE_DIR=.kite
# goto user home dir.
cd $INSTALL_DIR || exit
echo "🔄 Check install depends: git, php, composer"
if ! [ -x "$(command -v git)" ]; then
echo '🔴 Error: git is not installed.'
exit 1
fi
if ! [ -x "$(command -v php)" ]; then
echo '🔴 Error: php is not installed.'
exit 1
fi
if ! [ -x "$(command -v composer)" ]; then
echo '🔴 Error: composer is not installed.'
exit 1
fi
if [ -d "$INSTALL_DIR/$CLONE_DIR"/bin ]; then
echo "🙈 SKIP install, the kite dir exists"
exit
fi
echo "🟢 Fetch kite codes by git clone"
# download tool by git clone
git clone https://github.com/inhere/kite $CLONE_DIR
echo "🟢 Install deps by composer"
# shellcheck disable=SC2164
cd $CLONE_DIR
# install dep packages
composer install
echo "🟢 Initialize kite"
set -x
# add exec perm
chmod a+x bin/htu
chmod a+x bin/kite
# init user config
cp .kite.example.php .kite.php
# link bin file to ENV path
#sudo ln -s "$PWD"/bin/htu /usr/local/bin/htu
sudo ln -s "$PWD"/bin/kite /usr/local/bin/kite
set +x
echo "✅ Install successful"
kite --version