File tree Expand file tree Collapse file tree 1 file changed +24
-14
lines changed
Expand file tree Collapse file tree 1 file changed +24
-14
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
3- dir=. /lazy_bash
3+ dir=" $HOME /lazy_bash"
44
55function fetchrepo() {
66 # Clone git repo
7- git clone https://github.com/tim0n3/lazy-bash.git && cd lazy-bash
7+ echo -e " Preparing environment\n "
88 sleep 2
9+ echo -e " Fetching repo and installing shell overhaul.\n"
10+ git clone https://github.com/tim0n3/lazy-bash.git && cd lazy-bash
11+ }
12+
13+ function installdeps() {
914 # copy libraries to the user's home folder
1015 cp -R bash_aliases ~ /
11- sleep 2
16+
1217 # overwrite the current .bashrc and load the new shell features
1318 cat bashrc > ~ /.bashrc && cd ~ /
14- sleep 2
19+ }
20+
21+ function reloadshell() {
1522 # Go $Home and reload the shell
16- source . /.bashrc
23+ source ~ /.bashrc
1724 reloadbash
1825}
1926
27+
2028function cleanup() {
2129 # Remove detected folders with same name as git repo
2230 echo -e " Cleaning up left overs\n"
2331 rm -rf ~ /lazy-bash
2432}
2533
26- #
27- if [ -d ! ./bash_aliases ]; then
28- # Directory exists
29- fetchrepo;
34+ # Main function
35+ # Check ~/bash_aliases dir exists and cleaup else proceed \
36+ # with a normal installation:
37+ if [ -d ! " $HOME /bash_aliases" ]; then
38+ # Directory exists == redownload
39+ cleaup
40+ fetchrepo
41+ installdeps
42+ reloadshell
3043 sleep 2
3144else
32- # Directory doesn't exist
33- echo -e " Preparing environment\n"
34- cleanup;
35- sleep 2
36- echo -e " Fetching repo and installing shell overhaul.\n"
45+ # Directory doesn't exist == business as usual
3746 fetchrepo
47+ cleanup
3848fi
You can’t perform that action at this time.
0 commit comments