-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·137 lines (107 loc) · 2.9 KB
/
setup.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
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/env bash
# 1. Backup
# 2. Directories
# 3. Xcode CLI
# 4. Homebrew
# 5. Rosetta
# 6. Symlinks
# 7. Web development
# 8. Mobile development
# 9. Cron tasks
# 10. Misc.
debug=${1:-false} # default debug param.
source ./setup/lib.sh # load help lib.
# Help
bot "OK, what we're going to do:\n"
actioninfo "1. Backup directories and files we'll be touching."
actioninfo "2. Create required directories."
actioninfo "3. Install Xcode Command Line Tools."
actioninfo "4. Install Rosetta 2 for Intel based binaries."
actioninfo "5. Install Homebrew and all required apps."
actioninfo "6. Create symlinks for directories and files."
actioninfo "7. Environment Setup for web development."
actioninfo "8. Environment Setup for mobile development."
actioninfo "9. Cron Task setup."
actioninfo "10. Final touches."
# Ask for the administrator password upfront.
is_not_ci && ask_for_sudo
# ---------
# 1. Backup
# ---------
botintro "\e[1mSTEP 1: BACKUP\e[0m"
source ./setup/backup.sh
# --------------
# 2. Directories
# --------------
botintro "\e[1mSTEP 2: DIRECTORIES\e[0m"
source ./setup/directories.sh
# ------------
# 3. Xcode CLI
# ------------
botintro "\e[1mSTEP 3: XCODE CLI\e[0m"
source ./setup/xcodecli.sh
# ------------
# 4. Rosetta
# ------------
botintro "\e[1mSTEP 4: Rosetta\e[0m"
source ./setup/rosetta.sh
# -----------
# 5. Homebrew
# -----------
if is_not_ci || [[ ${RUN_SETUP_HOMEBREW} = true ]]; then
botintro "\e[1mSTEP 5: HOMEBREW\e[0m"
source ./setup/brew.sh
# brew is required to continue, exit out otherwise.
if ! $brewinstall; then
cancelled "\e[1mCannot proceed. Exit.\e[0m"
exit 1
fi
else
cancelled "Skipping Homebrew Installation on CI ..."
fi
# -----------
# 6. Symlinks
# -----------
botintro "\e[1mSTEP 6: SYMLINKS\e[0m"
source ./setup/symlinks.sh
# ------------------
# 7. Web Environment
# ------------------
botintro "\e[1mSTEP 7: Environment Setup for web development.\e[0m"
# asdf setup
source ./setup/asdf.sh
# Note: asdf minimal setup (alternative for the asdf full setup)
# source ./setup/asdf-minimal.sh
# Node setup
# source ./setup/node.sh
# Rust setup
# source ./setup/rust.sh
# vim setup
source ./setup/vim.sh
# miniconda setup
source ./setup/miniconda.sh
# vscode setup
source ./setup/vscode.sh
# chrome extensions setup
source ./setup/chrome.sh
# ---------------------
# 8. Mobile Environment
# ---------------------
if is_not_ci || [[ ${RUN_SETUP_RN} = true ]]; then
botintro "\e[1mSTEP 8: Environment Setup for mobile development.\e[0m"
source ./setup/react-native.sh
fi
# -------------
# 9. CRON Tasks
# -------------
botintro "\e[1mSTEP 9: Scheduling crontab tasks\e[0m"
source ./setup/cron.sh
# --------
# 10. Misc.
# --------
botintro "\e[1mSTEP 10: Final touches\e[0m"
source ./setup/misc.sh
# Wrap-up.
botintro "\e[1mFINISHED\e[0m -- That's it for the automated process."
echo -e "\np.s. don't forget to sync your dropbox and get mackup running.\n"
# EOF