-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstallMacOSpackages.sh
executable file
·106 lines (82 loc) · 2.33 KB
/
installMacOSpackages.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#!/bin/sh
# HomeBrew
echo "##################################"
echo " Homebrew "
echo "##################################"
if test ! "$(which brew)"; then
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/Siri.Mykland/.profile
eval "$(/opt/homebrew/bin/brew shellenv)"
else
# Update homebrew
echo "Updating homebrew..." && brew update
fi
# Apps to install Globally
echo "\n##################################"
echo " Brew packages "
echo "##################################"
apps=(
# Casks - UI-based apps
iterm2
rectangle
postman
google-chrome
spotify
visual-studio-code
intellij-idea
vmware-horizon-client
# Formulae
tmux
mosh
)
brew_exist() {
if brew list -1 | grep $1 &>/dev/null; then
return 0
else
return 1
fi
}
brew_install() {
if brew_exist "$1"; then
echo "${1} is already installed"
else
echo "\nInstalling $1"
brew install "$1" && echo "\n"
fi
}
for app in "${apps[@]}"; do
brew_install "$app"
done
#Docker
brew install --cask docker
# Post brew install
brew cleanup
echo "\n##################################"
echo " Node "
echo "##################################"
brew_install nvm
(echo; echo 'export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && \. "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion') >> ~/.profile
source ~/.profile
if test "$(which node)" && brew_exist node; then
echo "Uninstalling Node..."
brew uninstall --ignore-dependencies node
brew uninstall node
fi
if brew_exist nvm; then
nvm install 18
nvm install 22 --default
echo "\nYou got these versions of node:"
nvm ls --no-alias
fi
# oh-my-zsh
echo "\n##################################"
echo " Oh-My-Zsh "
echo "##################################"
zsh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
if -e ~/.zshrc.pre-oh-my-zsh ; then
mv ~/.zshrc.pre-oh-my-zsh ~/.zshrc
fi
source ~/.zshrc