@@ -40,7 +40,11 @@ function upgrade_sam_cli() {
4040
4141function upgrade_existing_packages() {
4242 _logger " [+] Upgrading system packages"
43- sudo yum update -y
43+ if [[ $( command -v apt-get) ]]; then
44+ sudo apt-get upgrade -y
45+ elif [[ $( command -v yum) ]]; then
46+ sudo yum update -y
47+ fi
4448
4549 _logger " [+] Upgrading Python pip and setuptools"
4650 python3 -m pip install --upgrade pip setuptools --user
@@ -60,13 +64,18 @@ function install_utility_tools() {
6064function install_linuxbrew() {
6165 _logger " [+] Creating touch symlink"
6266 sudo ln -sf /bin/touch /usr/bin/touch
63- _logger " [+] Installing homebrew..."
64- echo | sh -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh) "
65- _logger " [+] Adding homebrew in PATH"
66- test -d ~ /.linuxbrew && eval $( ~/.linuxbrew/bin/brew shellenv)
67- test -d /home/linuxbrew/.linuxbrew && eval $( /home/linuxbrew/.linuxbrew/bin/brew shellenv)
68- test -r ~ /.bash_profile && echo " eval \$ ($( brew --prefix) /bin/brew shellenv)" >> ~/.bash_profile
69- echo " eval \$ ($( brew --prefix) /bin/brew shellenv)" >> ~/.profile
67+
68+ if [[ $( command -v brew) == " " ]]; then
69+ _logger " [+] Installing homebrew..."
70+ echo | sh -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh) "
71+ _logger " [+] Adding homebrew in PATH"
72+ test -d ~ /.linuxbrew && eval $( ~/.linuxbrew/bin/brew shellenv)
73+ test -d /home/linuxbrew/.linuxbrew && eval $( /home/linuxbrew/.linuxbrew/bin/brew shellenv)
74+ test -r ~ /.bash_profile && echo " eval \$ ($( brew --prefix) /bin/brew shellenv)" >> ~/.bash_profile
75+ echo " eval \$ ($( brew --prefix) /bin/brew shellenv)" >> ~/.profile
76+ else
77+ _logger " [+] Homebrew already installed..."
78+ fi
7079}
7180
7281function main() {
0 commit comments