-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
82 lines (70 loc) · 2.83 KB
/
bootstrap.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Helper functions
infobanner()
{
echo "+------------------------------------------+"
printf "| %-40s |\n" "`date`"
echo "| |"
printf "|`tput bold` %-40s `tput sgr0`|\n" "$@"
echo "+------------------------------------------+"
}
titlebanner()
{
echo "\n"
echo "+------------------------------------------------------------------------------------------------+"
echo " ########:::'#######:::'#######::'########::'######::'########:'########:::::'###::::'########::
##.... ##:'##.... ##:'##.... ##:... ##..::'##... ##:... ##..:: ##.... ##:::'## ##::: ##.... ##:
##:::: ##: ##:::: ##: ##:::: ##:::: ##:::: ##:::..::::: ##:::: ##:::: ##::'##:. ##:: ##:::: ##:
########:: ##:::: ##: ##:::: ##:::: ##::::. ######::::: ##:::: ########::'##:::. ##: ########::
##.... ##: ##:::: ##: ##:::: ##:::: ##:::::..... ##:::: ##:::: ##.. ##::: #########: ##.....:::
##:::: ##: ##:::: ##: ##:::: ##:::: ##::::'##::: ##:::: ##:::: ##::. ##:: ##.... ##: ##::::::::
########::. #######::. #######::::: ##::::. ######::::: ##:::: ##:::. ##: ##:::: ##: ##::::::::
........::::.......::::.......::::::..::::::......::::::..:::::..:::::..::..:::::..::..:::::::::"
printf "+---Created By `tput bold`Oliver Haney`tput sgr0`----------------------------------------------------------------------+"
echo "\n\n"
}
titlebanner
sleep 2s
# Install homebrew
if ! command -v brew &> /dev/null; then
# The package is not installed
infobanner 'Installing Homebrew'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
infobanner 'Homebrew installed successfully'
else
# The package is installed
infobanner 'Homebrew already installed'
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
brew update
brew upgrade
infobanner 'Homebrew up to date!'
infobanner 'Running Hombrew doctor'
brew doctor --list-checks
fi
infobanner "Installing dev packages..."
# Install dev packages
brew tap AdoptOpenJDK/openjdk
brew install --cask adoptopenjdk8
brew install --cask adoptopenjdk11
brew install python
brew install npm
brew install gradle
brew install [email protected]
COUNTER=0
PROCESSED_ALIASES=""
infobanner 'Bootstrapping machine!'
printf "\n`tput bold`Aliases registered:\n"
while IFS="" read -r line || [ -n "$line" ]
do
if [ $COUNTER -eq 22 ]; then
break
else
echo $line | awk -F. '{print substr($0,7)}'
fi
(( COUNTER=$COUNTER+1 ))
done < .bashrc
echo $PROCESSED_ALIASES
cp .bashrc ~/.bashrc
(cd /tmp && ([[ -d sexy-bash-prompt ]] || git clone --depth 1 --config core.autocrlf=false https://github.com/twolfson/sexy-bash-prompt) && cd sexy-bash-prompt && make install) && source ~/.bashrc
infobanner '.bashrc initialized'
infobanner 'Bootstrapping completed!'