-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart-base
executable file
·85 lines (68 loc) · 2.26 KB
/
start-base
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
#!/usr/bin/env bash
##
# Unopinionated entry script for the pydotfiles module
# that will just install pydotfiles
##
configuration_repo_git_link=$1
# Pretty output functions
function info () {
printf "\\t [\\033[00;34mINFO\\033[0m] %s\\n" "${1}"
}
function user () {
printf "\\t [ \\033[0;33m??\\033[0m ] %s\\n" "${1}"
}
function success () {
printf "\\t\\033[2K [ \\033[00;32mOK\\033[0m ] %s\\n" "${1}"
}
function warn () {
printf "\\t\\033[2K [\\033[38:2:255:165:0mWARN\\033[0m] %s\\n" "${1}"
}
function fail () {
printf "\\t\\033[2K [\\033[0;31mFAIL\\033[0m] %s\\n" "${1}"
exit 1
}
function start() {
dotfiles_setup "${configuration_repo_git_link}"
}
# Dotfiles functions
function dotfiles_setup() {
configuration_repo_git_link=$1
dotfiles_install_pydotfiles
dotfiles_setup_pydotfiles "$configuration_repo_git_link"
}
function dotfiles_install_pydotfiles() {
if [[ $(pip freeze | grep "pydotfiles") == "" ]]; then
info "Pydotfiles: The pydotfiles pip package was not installed yet, installing now"
if pip install pydotfiles ; then
success "Pydotfiles: Successfully installed pydotfiles"
else
fail "Pydotfiles: Failed to install pydotfiles"
fi
else
success "Pydotfiles: Already installed pydotfiles"
fi
}
function dotfiles_setup_pydotfiles() {
configuration_repo_git_link=$1
if pydotfiles download -r "$configuration_repo_git_link" ; then
success "Pydotfiles: Successfully downloaded the pydotfiles configurations"
else
fail "Pydotfiles: Failed to download the pydotfiles configurations"
fi
if pydotfiles install ; then
success "Pydotfiles: Successfully installed the pydotfiles configurations"
else
fail "Pydotfiles: Failed to install the pydotfiles configurations"
fi
}
function install_xcode() {
# Code from https://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line/195963#195963
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l |
grep "\\*.*Command Line" |
tail -n 1 | awk -F"*" '{print $2}' |
sed -e 's/^ *//' |
tr -d '\n')
softwareupdate -i "${PROD}" --verbose;
}
start