-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-tools.sh
executable file
·66 lines (55 loc) · 1.71 KB
/
setup-tools.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
64
65
66
#!/bin/bash
echo "Setting up tools"
cd ..
echo "Set up .profile file and add Gitify to path"
PROFILE=.profile
if [ ! -e "$PROFILE" ]; then
touch "$PROFILE"
fi
if [ ! -w "$PROFILE" ]; then
echo "Cannot write to $PROFILE"
else
echo PATH=$PATH:"${PWD}/tools/gitify" > "$PROFILE"
echo "alias g='git'" >> "$PROFILE"
echo "alias gs='git status '" >> "$PROFILE"
echo "alias ga='git add '" >> "$PROFILE"
echo "alias gb='git branch '" >> "$PROFILE"
echo "alias gc='git commit -m'" >> "$PROFILE"
echo "alias gd='git diff'" >> "$PROFILE"
echo "alias gl='git pull'" >> "$PROFILE"
echo "alias gp='git push'" >> "$PROFILE"
fi
echo "Added to $PROFILE"
echo "Set up .user_bashrc file and add aliases and settings"
BASHRC=.user_bashrc
if [ ! -e "$BASHRC" ]; then
touch "$BASHRC"
fi
if [ ! -w "$BASHRC" ]; then
echo "Cannot write to $BASHRC"
else
echo "export PATH=/www/htdocs/${USER##*\-}/tools/gitify/:$PATH" > "$BASHRC"
echo "alias g='git'" >> "$BASHRC"
echo "alias gs='git status '" >> "$BASHRC"
echo "alias ga='git add '" >> "$BASHRC"
echo "alias gb='git branch '" >> "$BASHRC"
echo "alias gc='git commit -m'" >> "$BASHRC"
echo "alias gd='git diff'" >> "$BASHRC"
echo "alias gl='git pull'" >> "$BASHRC"
echo "alias gp='git push'" >> "$BASHRC"
echo "alias php='/usr/bin/php72'" >> "$BASHRC"
fi
source "./$BASHRC"
echo "Added to $BASHRC"
mkdir -p tools
cd tools
mkdir composer
cd composer
curl -sS https://getcomposer.org/installer | php
cd ..
git clone https://github.com/modmore/Gitify.git gitify
cd gitify
php ../composer/composer.phar install
chmod +x Gitify
cd ..
echo "Deployment-Tools composer and Gitify installed. Gitify added through $PROFILE to PATH"