-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_mac.sh
executable file
·81 lines (61 loc) · 1.66 KB
/
setup_mac.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
#!/bin/sh
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
blue=`tput setaf 4`
reset=`tput sgr0`
# Variables definition
CURRENT=$PWD
source shell/install_functions.sh
# Banner
echo ""
echo " +--------------------+"
echo " | ${green}Starting Mac setup${reset} |"
echo " +--------------------+"
echo ""
# Install zim
ZIMRC_FILE=~/.zimrc
if [ -f "$ZIMRC_FILE" ]; then
echo "${yellow}Zim seems already installed skipping step.${reset}"
else
echo "> ${green}Installing ZIM.${reset}"
curl -fsSL https://raw.githubusercontent.com/zimfw/install/master/install.zsh | zsh
fi
echo ""
# Disable Last login on terminal
HUSHLOGIN_FILE=~/.hushlogin
if [ -f "$HUSHLOGIN_FILE" ]; then
echo "${yellow}Hushlogin file already there.${reset}"
else
echo "> ${green}Adding hushlogin file.${reset}"
touch $HUSHLOGIN_FILE
fi
echo ""
# Brew install
if ! command -v brew &> /dev/null
then
echo "> ${green}Installing brew${reset}"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
else
echo "${yellow}Brew already installed${reset}"
fi
echo ""
# Installing Brew apps
echo "> ${green}Installing brew apps${reset}"
brew bundle --file="mac/Brewfile"
echo ""
# Configuring git
echo "> ${green}Configuring git${reset}"
create_links "links/git.config"
echo ""
# Configuring ZSH
echo "> ${green}Configuring shell (ZSH)${reset}"
create_links "links/zsh.config"
echo ""
# Mac setup
echo "> ${green}Running mac setup${reset}"
./mac/macos-setup.sh
echo ""
echo "${blue}Installation finished. Please, restart the shell.${reset}"