-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwshell-installer
executable file
·45 lines (34 loc) · 1.19 KB
/
wshell-installer
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
#!/usr/bin/env bash
for i in git curl;do
if [ ! `command -v git` ];then
echo 'Install Wshell failed'
echo 'Wshell need git'
exit 0
fi
done
WS_HOME=${HOME}/.wshell
test -d ${WS_HOME} || git clone https://github.com/wxnacy/wshell ${WS_HOME}
BP=~/.bashrc
if [[ ! $PATH =~ '.wshell/bin' ]];then
echo 'WARNING: seems you still have not added 'wshell' to the load path.'
echo ''
echo '# Load wshell automatically by commands'
# echo '# Load wshell automatically by adding'
# echo "# the following to ${BP}:"
echo -n -e "\t"echo \'
echo -n 'export WS_HOME="${HOME}/.wshell"'
echo \' '>> ~/.bashrc'
echo -n -e "\t"echo \'
echo -n 'export PATH="${WS_HOME}/bin:$PATH"'
echo \' '>> ~/.bashrc'
echo -n -e "\t"echo \'
echo -n '. ${WS_HOME}/conf/bash/bashrc'
echo \' '>> ~/.bashrc'
echo -e "\tsource ~/.bashrc"
# echo 'export WS_HOME="${HOME}/.wshell"'
# echo 'export PATH="${WS_HOME}/bin:$PATH"'
# echo '. ${WS_HOME}/conf/system/bashrc'
fi
# echo 'export WSPATH=${HOME}/.wshell' >> ~/.bashrc
# echo 'export PATH=${WSPATH}/bin:$PATH' >> ~/.bashrc
# echo -e 'echo \'export PATH=${WSPATH}/bin:$PATH\' >> ~/.bashrc'