File tree Expand file tree Collapse file tree 1 file changed +20
-16
lines changed
Expand file tree Collapse file tree 1 file changed +20
-16
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22
33dir=" $HOME /lazy_bash"
4+ aliasdir=" $HOME /bash_aliases"
45
56function fetchrepo() {
67 # Clone git repo
78 echo -e " Preparing environment\n"
8- sleep 2
9+ sleep 1
910 echo -e " Fetching repo and installing shell overhaul.\n"
10- git clone https://github.com/tim0n3/lazy-bash.git && cd lazy-bash
11- }
11+ sleep 1
12+ git clone https://github.com/tim0n3/lazy-bash.git " $dir " && cd " $dir " || exit 1
13+ }
1214
1315function installdeps() {
14- # copy libraries to the user's home folder
15- cp -R bash_aliases ~ /
16+ # Copy libraries to the user's home folder
17+ cp -R " $dir / bash_aliases" " $HOME / "
1618
17- # overwrite the current .bashrc and load the new shell features
18- cat bashrc > ~ /.bashrc && cd ~ /
19+ # Overwrite the current .bashrc and load the new shell features
20+ cat " $dir / bashrc" > " $HOME /.bashrc" && cd " $HOME " || exit 1
1921}
2022
2123function reloadshell() {
2224 # Go $Home and reload the shell
23- source ~ /.bashrc
24- reloadbash
25+ source " $HOME /.bashrc"
2526}
2627
27-
2828function cleanup() {
29- # Remove detected folders with same name as git repo
30- echo -e " Cleaning up left overs \n"
31- rm -rf ~ /lazy-bash
29+ # Remove detected folders with the same name as git repo
30+ echo -e " Cleaning up leftovers \n"
31+ rm -rf " $dir " " $aliasdir "
3232}
3333
3434# Main function
35- # Check ~/bash_aliases dir exists and cleaup else proceed \
35+ # Check ~/bash_aliases dir exists and cleanup else proceed \
3636# with a normal installation:
37- if [ -d ! " $HOME /bash_aliases" ]; then
37+ if [ -d " $HOME /bash_aliases" ]; then
3838 # Directory exists == redownload
39- cleaup
39+ cleanup
4040 fetchrepo
4141 installdeps
4242 reloadshell
43+ cleanup
4344 sleep 2
4445else
4546 # Directory doesn't exist == business as usual
4647 fetchrepo
48+ installdeps
49+ reloadshell
4750 cleanup
4851fi
52+
You can’t perform that action at this time.
0 commit comments