-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·63 lines (54 loc) · 1.44 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
63
#!/bin/bash
INSTALL_DIR=~/.powerline
if [ -z "$(which php)" ]; then
echo "Error: PHP not found. Please install php-cli and try again."
exit 1
fi
if [ ! -d $INSTALL_DIR ]; then
echo "Creating directory: $INSTALL_DIR"
mkdir -p $INSTALL_DIR
fi
echo -n "Installing php-powerline:"
cp -R lib $INSTALL_DIR/
cp -R bin $INSTALL_DIR/
cp powerline.sh $INSTALL_DIR/
cp powerline.fish $INSTALL_DIR/
echo " Done"
echo -n "Installing modules:"
MODULES_SRC=./modules
MODULES_DST=$INSTALL_DIR/modules
if [ ! -d $MODULES_DST ]; then
mkdir $MODULES_DST
fi
for MODULE in $MODULES_SRC/*.php; do
# echo " ~> $(basename $MODULE .php)"
cp $MODULE $MODULES_DST
done
echo " Done"
echo -n "Installing themes:"
THEMES_SRC=./themes
THEMES_DST=$INSTALL_DIR/themes
if [ ! -d $THEMES_DST ]; then
mkdir $THEMES_DST
fi
for THEME in $THEMES_SRC/*.theme; do
# echo " ~> $(basename $THEME .theme)"
cp $THEME $THEMES_DST
done
echo " Done"
if [ ! -d ~/bin ]; then
echo "Skipping automatic symlink creation, please add $INSTALL_DIR/bin to your path."
else
echo -n "Creating symlinks:"
for TOOL in $INSTALL_DIR/bin/*; do
# echo " ~> $(basename $TOOL)"
test -e ~/bin/$(basename $TOOL) || ln -s $TOOL ~/bin/$(basename $TOOL)
done
fi
echo " Done"
grep "powerline.sh" ~/.bashrc &>/dev/null
if [ $? != 0 ]; then
echo "source $INSTALL_DIR/powerline.sh" >> ~/.bashrc
echo "Added phpl to .bashrc"
fi
$INSTALL_DIR/bin/phpl-reload --all