-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·127 lines (104 loc) · 3.5 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
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
# Hello, Welcome to macOS setup for devs.
# Author: https://github.com/logeshpaul
# Source: https://github.com/logeshpaul/dotfiles
## Custom color codes & utility functions
source helper/utility.sh
# Welcome msg
# ---------------
e_bold "${tan}Hello!"
e_header "MacOS Setup"
e_text "Please enter your password for performing Mac Customizations"
source osx/dock.sh
source osx/functions.sh
source osx/mission-control.sh
source osx/screen.sh
source osx/terminal.sh
source osx/ui.sh
# Create Necessary Directories
# ----------------------------
e_text "Creating directory structure..."
cd ~/ && mkdir Codelabs && mkdir Works
cd ~/dotfiles
# Git configuration
# -----------------
e_header "Setup git config (global)"
cp gitignore ~/.gitignore_global ## Adding .gitignore global
git config --global core.excludesfile "${HOME}/.gitignore_global"
ask "${blue} (Option) Enter Your Github Email: "
read -r emailId
if is_empty $emailId; then
git config --global user.email "$emailId" ## Git Email Id
e_success "Email is set"
else
e_error "Not set"
fi
ask "${blue} (Option) Enter Your Github Username: "
read -r userName
if is_empty $userName; then
git config --global user.name "$userName" ## Git Username
e_success "Username is set"
else
e_error "Not set"
fi
# Install Oh-My-Zsh & custom aliases
# ----------------------------------
ZSH=~/.oh-my-zsh
if [ -d "$ZSH" ]; then
e_warning "Oh My Zsh is already installed. Skipping.."
else
e_header "Installing Oh My Zsh..."
curl -L http://install.ohmyz.sh | sh
git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm
## To install ZSH themes & aliases
e_header "Copying ZSH themes & aliases..."
e_note "Check .aliases file for more details."
cp oh-my-zsh/aliases ~/.aliases ## Copy aliases
cp oh-my-zsh/zshrc ~/.zshrc ## Copy zshrc configs
cp oh-my-zsh/dracula.zsh-theme ~/.oh-my-zsh/themes/dracula.zsh-theme ## Copy custom dracula theme
cp -R oh-my-zsh/z ~/z ## Copy z.sh autocompletion file
git clone https://github.com/peterhurford/git-it-on.zsh ~/.oh-my-zsh/custom/plugins/git-it-on ## Copy git it on utilities plugin
fi
# Install Homebrew
# ----------------
if test ! $(which brew); then
e_header "Installing Homebrew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
e_warning "Homebrew is already installed. Skipping.."
fi
# Install NodeJS
# --------------
if test ! $(which nvm); then
e_header "Installing nvm.."
brew install nvm
nvm install stable ## Installing stable version of node
nvm use stable ## Setting stable as default node
nvm use --delete-prefix stable
## To setup npm install/update -g without sudo
# TODO: Some errors regarding this
cp npmrc ~/.npmrc
mkdir "${HOME}/.npm-packages"
export PATH="$HOME/.node/bin:$PATH"
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
## Set npm global config
npm config set init.author.name "Logesh Paul" ## Replace it with your name
npm config set init.author.email "[email protected]" ## Replace it with your email id
else
e_warning "NVM is already installed. Skipping.."
fi
## Yarn install
# -------------
if ! type yarn > /dev/null
then
e_header "Install yarn.."
brew install yarn
fi
## Remove cloned dotfiles from system
# TODO: Check if this is needed
# if [ -d ~/dotfiles ]; then
# sudo rm -R ~/dotfiles
#fi
e_thanks "Author: https://github.com/logeshpaul \n"
echo "🍺 Thats all, Done. Note that some of these changes require a logout/restart to take effect."
# END