-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
68 lines (59 loc) · 2.07 KB
/
install.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
#!/usr/bin/env bash
function __homebrew__() {
if ! brew --version &> /dev/null; then
echo "Installing Homebrew..."
sudo -v
NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if ! brew --version &> /dev/null; then
echo "Adding brew to PATH"
echo '# Set PATH, MANPATH, etc., for Homebrew.' >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
echo "Homebrew is already installed"
}
function __zsh__() {
brew install zsh
echo "Installing oh-my-zsh..."
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
}
function __npm__() {
if ! node --version &> /dev/null; then
echo "Installing node"
curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
fi
echo "Node is already installed"
echo "Installing NPM global packages..."
while read line; do npm i -g "$line"; done < npm.txt
}
function __workbrew__() {
echo "Installing Brew packages for work..."
__homebrew__
brew bundle --file=mac_os/work/Brewfile
}
function __probrew__() {
echo "Installing Brew packages for work..."
__homebrew__
brew bundle --file=mac_os/Brewfile
}
function __choco__() {
echo "Installing Windows OS apps..."
source windows_os/install.sh
}
function __pip__() {
echo "Installing PIP global packages..."
brew install python
pip3 install --upgrade pip
pip3 install --upgrade -r pip.txt
}
if [ "$1" != "" ] && type "__$1__" &> /dev/null; then
eval "__$1__"
elif [ "$1" == "--all" ]; then
__homebrew__
__npm__
__pip__
__zsh__
else
echo "Usage: ./install.sh (homebrew/ brew/ oh-my-zsh/ npm/ pip/ choco (for Windows OS) | --all)"
fi