-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer.sh
executable file
·117 lines (94 loc) · 3.48 KB
/
installer.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
#!/usr/bin/env bash
#################################################################################
# File : installer.sh
# Description : Bootstrapper for macOS dotfiles installation.
# Args :
# Dependencies : utils.sh, brew, git
# Author : topscoder
# Email : topscoder.at.gmail.dot.com
#################################################################################
source ./utils.sh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Ask for the administrator password upfront
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sudo --validate
clear_logs
log_info "installer.sh starting..."
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Only clone if .dotfiles are not installed already
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if [ ! -d "~/.dotfiles" ]
then
brew install git
git clone https://github.com/topscoder/topscoder.git ~/.dotfiles/
else
git update
fi
cd ~/.dotfiles/
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Check if we are in .dotfiles folder now. It's important. We need 'em
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# if [ ! -d "~/.dotfiles" ]
# then
# print_error " ==> IT LOOKS LIKE THE .DOTFILES FOLDER IS NOT INSTALLED."
# print_error " ==> PLEASE FIX IT. "
# print_error " ==> I QUIT. 👋 "
# exit 1
# fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install ZSH shell
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sh ~/.dotfiles/dots/.app-zsh
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install Homebrew
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sh ~/.dotfiles/dots/.app-homebrew
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install and upgrade (by default) cli-tools, apps from the Brewfile (.brewfile).
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
brew bundle --file=~/.dotfiles/dots/.brewfile
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Install Irvue wallpaper manager from App Store
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
mas install 1039633667
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Unlock quarantaine mode for apps
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sh ~/.dotfiles/dots/.macos-unlocker
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Git configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sh ~/.dotfiles/dots/.conf-git
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# macOS configuration
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
conf_mac=(
'.macos'
'.macos-user-defaults'
'.macos-paulirish'
'.macos-dock')
for cfile in "${conf_mac[@]}";
do
cmd="sh ~/.dotfiles/dots/$cfile"
/bin/bash -c "$cmd"
done
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Application settings YEEHA!
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apps=(
'.app-vscodium'
'.app-dropbox-maestral'
'.app-mackup'
'.app-sync')
for afile in "${apps[@]}";
do
cmd="sh ~/.dotfiles/dots/$afile"
/bin/bash -c "$cmd"
done
# Done
print_info 'Restart'
ask_for_confirmation 'Do you want to reboot now?'
if answer_is_yes; then
restart
fi
finish_block " 😽 KTHXBAI"