-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
Β·47 lines (39 loc) Β· 1.08 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
#! /bin/bash
echo "installing" $1
echo "Proceed ? (y/n)"
read $lock
add_addon_git() {
cat ./addons/git >>~/.bashrc
}
add_addon_git_plain() {
cat ./addons/git_plain >>~/.bashrc
}
add_addon_status() {
cat ./addons/exitstat >>~/.bashrc
}
add_addon_status_plain() {
cat ./addons/exitstat_plain >>~/.bashrc
}
add_alias() {
cat ./addons/alias >>~./bashrc
}
if [[ $lock -eq "y" ]]; then
echo "backing up the current .bashrc as .bashrc.bak"
cp ~/.bashrc ~/.bashrc.bak
sed -i '/^export PS1/s//#&/' ~/.bashrc
if [[ $1 == "p" ]]; then
add_addon_git_plain
add_addon_status_plain
new_prompt='[ \u @ \h \W ] [ \d - \@ ] $(gitbranch_plain) $(exitstatus) \n~> ' # Plain - no addons
elif
[[ $1 == "e" ]]
then
{
add_addon_git
new_prompt='\n π
\d - π‘ \@ \n π¨β \u @ π°οΈ \h : π \W ) $(exitstatus) $(gitbranch) \n β‘ ' # Emoji - no addons
add_addon_status
}
fi
echo "# code injected by Rocket prompt" >>~/.bashrc
echo "export PS1='$new_prompt'" >>~/.bashrc
fi