-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdotfiles
executable file
·619 lines (521 loc) · 19.7 KB
/
dotfiles
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
#!/bin/bash
################################################################################
# variables
SYSTEM_TIMEZONE=${SYSTEM_TIMEZONE:-Europe/London}
SYSTEM_LOCALE=${SYSTEM_LOCALE:-en_GB.UTF-8}
GITHUB_ACCOUNT=${GITHUB_ACCOUNT:-stefaniuk}
GITLAB_ACCOUNT=${GITLAB_ACCOUNT:-stefaniuk}
BITBUCKET_ACCOUNT=${BITBUCKET_ACCOUNT:-stefaniuk}
BASH_PROMPT_SHOW_GIT=${BASH_PROMPT_SHOW_GIT:-yes}
BASH_PROMPT_RELOAD_HISTORY=${BASH_PROMPT_RELOAD_HISTORY:-no}
BASH_MEASURE_EXEC_TIME=${BASH_MEASURE_EXEC_TIME:-no}
BASH_LOAD_DOTFILES=${BASH_LOAD_DOTFILES:-yes}
DIR=~
program_dir=$(cd "$(dirname "$0" 2> /dev/null)"; pwd)
app_dir=/usr/local/dotfiles
user_uid=$(id -u)
user_gid=$(id -g)
arg_config_apps=$(echo "$*" | grep -o -- "--config=[-_,A-Za-z0-9]*" | sed "s/--config=//")
arg_config=$(echo "$*" | grep -o -- "--config")
arg_customise=$(echo "$*" | grep -o -- "--customise")
arg_debug=$(echo "$*" | grep -o -- "--debug"); [ -n "$arg_debug" ] && set -x
arg_directory=$(echo "$*" | grep -Eo -- "--directory=[-_A-Za-z0-9/]+" | sed "s/--directory=//")
arg_extension_man=$(echo "$*" | grep -o -- "--extension-man")
arg_fix_file_ownership=$(echo "$*" | grep -o -- "--fix-file-ownership")
arg_force_download=$(echo "$*" | grep -o -- "--force-download")
arg_force_initialise=$(echo "$*" | grep -o -- "--force-initialise")
arg_help=$(echo "$*" | grep -o -- "--help")
arg_install_apps=$(echo "$*" | grep -o -- "--install=[-_,A-Za-z0-9]*" | sed "s/--install=//")
arg_install=$(echo "$*" | grep -o -- "--install")
arg_load_secrets=$(echo "$*" | grep -o -- "--load-secrets")
arg_minimal=$(echo "$*" | grep -o -- "--minimal")
arg_offline=$(echo "$*" | grep -o -- "--offline")
arg_sudo=$(echo "$*" | grep -o -- "--sudo")
arg_synchronise_only=$(echo "$*" | grep -o -- "--synchronise-only")
arg_test=$(echo "$*" | grep -o -- "--test")
arg_update=$(echo "$*" | grep -o -- "--update-os")
arg_user=$(echo "$*" | grep -Eo -- "--user=[-_A-Za-z0-9/]+" | sed "s/--user=//")
install_already_processed=""
config_already_processed=""
if [ -z "$arg_config_apps" ] && [ -n "$arg_install_apps" ]; then
arg_config_apps=$arg_install_apps
fi
IFS=',' read -r -a arg_install_apps_arr <<< "$arg_install_apps"
IFS=',' read -r -a arg_config_apps_arr <<< "$arg_config_apps"
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
script_pipe=true
fi
################################################################################
# functions
function main {
[ -n "$arg_help" ] && { usage; exit 0; }
[ -n "$arg_sudo" ] && sudo_keep_alive
[ -n "$arg_directory" ] && DIR=$arg_directory
# use colours in terminal
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color > /dev/null 2>&1; then
export TERM="gnome-256color"
elif infocmp xterm-256color > /dev/null 2>&1; then
export TERM="xterm-256color"
fi
# make sure user is known
if [ -z "$arg_minimal" ] && ([ -z "$USER_NAME" ] || [ -z "$USER_EMAIL" ]); then
print_err "USER_NAME and USER_EMAIL variables are not set"
exit 1
fi
# back up profile
[ -f $DIR/.profile ] && [ ! -f $DIR/.profile.old ] && mv -v $DIR/.profile $DIR/.profile.old
[ -f $DIR/.bash_profile ] && [ ! -f $DIR/.bash_profile.old ] && mv -v $DIR/.bash_profile $DIR/.bash_profile.old
# use gosu
if ! which sudo > /dev/null 2>&1 && which gosu > /dev/null 2>&1; then
printf '#!/bin/bash\ngosu root $*\n' > /usr/bin/sudo
chmod +x /usr/bin/sudo
fi
# make dotfiles scripts available
export PATH=$PATH:$DIR/bin:$DIR/usr/bin:$program_dir/bin:$program_dir/usr/bin
if [ -n "$script_pipe" ] || [ -n "$arg_force_download" ]; then
# download from the GitHub repository
dotfiles_download
elif [[ $program_dir == */projects/$GITHUB_ACCOUNT/dotfiles ]] || [[ $program_dir == */projects/dotfiles ]] || [[ $program_dir == /project ]]; then
# synchronise with the project content
dotfiles_synchronise
[ -n "$arg_synchronise_only" ] && exit 0
fi
# decrypt and load secrets
[ -n "$arg_load_secrets" ] && dotfiles_load_secrets
# perform installation and configuration
dotfiles_setup $*
print_h1 "Done!"
}
function sudo_keep_alive {
# update user's time stamp, prompting for password if necessary
sudo -v
# keep-alive until script has finished then invalidate sudo session
while true; do
sudo -n true
sleep 1
if ! kill -0 "$$"; then
sudo -k
exit
fi
done 2>/dev/null &
}
function dotfiles_download {
print_h3 "\nDownload dotfiles\n"
curl -L \
"https://github.com/${GITHUB_ACCOUNT}/dotfiles/tarball/master?$(date +%s)" \
-o $DIR/dotfiles.tar.gz
tar -zxf $DIR/dotfiles.tar.gz -C $DIR
rm -rf $DIR/etc/profile.d
cp -rf $DIR/$GITHUB_ACCOUNT-dotfiles-*/{.bash,}* $DIR
rm -rf $DIR/$GITHUB_ACCOUNT-dotfiles-*
rm -f $DIR/dotfiles.tar.gz
if [ -n "$arg_extension_man" ]; then
print_h3 "\nDownload dotfiles-man\n"
curl -L \
"https://github.com/${GITHUB_ACCOUNT}/dotfiles-man/tarball/master?$(date +%s)" \
-o $DIR/dotfiles-man.tar.gz
tar -zxf $DIR/dotfiles-man.tar.gz -C $DIR
rm -rf $DIR/man
cp -rf $DIR/$GITHUB_ACCOUNT-dotfiles-man-*/* $DIR
rm -rf $DIR/$GITHUB_ACCOUNT-dotfiles-man-*
rm -f $DIR/dotfiles-man.tar.gz
fi
}
function dotfiles_synchronise {
print_h3 "\nSynchronise dotfiles\n"
rsync -rav \
--include=/ \
--exclude=/.git \
--exclude=/opt/* \
--exclude=.gitignore \
--exclude=.gitkeep \
--exclude=LICENCE \
--exclude=README.md \
--exclude=*.test \
$program_dir/{.bash*,.git*,.*rc,} \
$DIR \
| grep -Ev "/$"
if [ -n "$arg_extension_man" ]; then
print_h3 "\nSynchronise dotfiles-man\n"
rsync -rav \
--include=/ \
--exclude=/.git \
--exclude=.gitignore \
--exclude=.gitkeep \
--exclude=LICENCE \
--exclude=README.md \
${program_dir}-man/* \
$DIR \
| grep -Ev "/$"
fi
}
function dotfiles_load_secrets {
for in_file in $(find $DIR/usr/etc -iname '*.enc' 2> /dev/null); do
echo $in_file
out_file=$(mktemp $DIR/tmp/tmp.XXXXXXXX)
openssl enc -aes-256-cbc -d -a -in $in_file -out $out_file
trap "rm -f $out_file" EXIT
source $out_file
done
}
function dotfiles_setup {
# detect operating system
source $DIR/.bash_system
print_h1 "Checking..."
# check internet connection
curl --silent --insecure --max-time 10 --retry 3 "https://google.com" > /dev/null
if [[ $? -ne 0 ]]; then
arg_offline=true
print_err "No network"
fi
# check operating system
if [ $DIST != "macosx" ] && [ $DIST != "ubuntu" ] && [ $DIST != "raspbian" ]; then
print_err "Operating system not supported"
fi
os_common
os_initialise
[ -n "$arg_update" ] && (
os_update
)
[ -n "$arg_install" ] && (
_app_dir_setup
os_install_apps
)
[ -n "$arg_config" ] && (
_app_dir_setup
os_config_apps
)
[ -n "$arg_customise" ] && (
os_customise
)
[ -n "$arg_test" ] && (
os_test
)
dotfiles_shell
# cleanup
rm -f $DIR/{LICENCE,README.md}
find $DIR/bin -iname '*.test' -exec rm {} \;
find $DIR/tmp -iname '.git*' -exec rm {} \;
if [ -n "$arg_minimal" ]; then
rm -rf \
$DIR/{etc/profile.d,lib,opt,tmp,usr/bin,usr/etc}/* \
$DIR/.profile.old
fi
print_h1 "Finalising..."
# set correct file ownership
if [ -n "$arg_fix_file_ownership" ]; then
[ -z "$arg_user" ] && sudo chown -R $user_uid:$user_gid $DIR 2>/dev/null ||:
[ -n "$arg_user" ] && sudo chown -R $arg_user:$arg_user $DIR 2>/dev/null ||:
fi
}
function dotfiles_shell {
rm -f $DIR/.dotfiles_config
echo "export BASH_LOAD_DOTFILES=\"\${BASH_LOAD_DOTFILES:-$BASH_LOAD_DOTFILES}\"" >> $DIR/.dotfiles_config
echo "export BASH_MEASURE_EXEC_TIME=\"\${BASH_MEASURE_EXEC_TIME:-$BASH_MEASURE_EXEC_TIME}\"" >> $DIR/.dotfiles_config
echo "export BASH_PROMPT_RELOAD_HISTORY=\"\${BASH_PROMPT_RELOAD_HISTORY:-$BASH_PROMPT_RELOAD_HISTORY}\"" >> $DIR/.dotfiles_config
echo "export BASH_PROMPT_SHOW_GIT=\"\${BASH_PROMPT_SHOW_GIT:-$BASH_PROMPT_SHOW_GIT}\"" >> $DIR/.dotfiles_config
echo "export BITBUCKET_ACCOUNT=\"\${BITBUCKET_ACCOUNT:-$BITBUCKET_ACCOUNT}\"" >> $DIR/.dotfiles_config
echo "export GITHUB_ACCOUNT=\"\${GITHUB_ACCOUNT:-$GITHUB_ACCOUNT}\"" >> $DIR/.dotfiles_config
echo "export USER_EMAIL=\"\${USER_EMAIL:-$USER_EMAIL}\"" >> $DIR/.dotfiles_config
echo "export USER_NAME=\"\${USER_NAME:-$USER_NAME}\"" >> $DIR/.dotfiles_config
echo "export GIT_AUTHOR_EMAIL=\"\$USER_EMAIL\"" >> $DIR/.dotfiles_config
echo "export GIT_AUTHOR_NAME=\"\$USER_NAME\"" >> $DIR/.dotfiles_config
echo "export GIT_COMMITTER_EMAIL=\"\$GIT_AUTHOR_EMAIL\"" >> $DIR/.dotfiles_config
echo "export GIT_COMMITTER_NAME=\"\$GIT_AUTHOR_NAME\"" >> $DIR/.dotfiles_config
}
function os_common {
if [ $DIST = "macosx" ]; then
brew_update="brew update --verbose"
brew_upgrade="brew upgrade --verbose"
brew_tap="brew tap"
brew_install="brew install --force --verbose"
cask_install="brew cask install --force --verbose"
mas_upgrade="mas upgrade"
mas_install="mas install"
if ! which brew > /dev/null; then
if ! xcode-select -p | grep '/Applications/Xcode.app/Contents/Developer' > /dev/null 2>&1; then
xcode-select --install
sudo xcodebuild -license accept > /dev/null 2>&1
fi
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$brew_tap caskroom/cask
$brew_tap caskroom/versions
fi
if ! which mas > /dev/null; then
$brew_install mas # SEE: https://github.com/mas-cli/mas
$mas_upgrade
fi
fi
if [ $DIST = "ubuntu" ]; then
DEBIAN_FRONTEND=noninteractive
apt_get_update="sudo apt --yes update"
apt_get_upgrade="sudo apt --yes upgrade"
apt_get_install="sudo apt --yes --ignore-missing --no-install-recommends install"
apt_get_remove="sudo apt --yes remove"
apt_add_repository="sudo apt-add-repository --yes"
fi
}
function os_initialise {
[ -f $DIR/tmp/.dotfiles-os-initialised ] && [ -z "$arg_force_initialise" ] && return
print_h1 "Initialising..."
if [ $DIST = "macosx" ]; then
if [ -z "$arg_offline" ] && [ ! -f $(brew --prefix)/bin/bash ]; then
$brew_install bash
sudo -E file_remove_str "\n$(brew --prefix)/bin/bash" /private/etc/shells --multiline
sudo bash -c "echo $(brew --prefix)/bin/bash >> /private/etc/shells"
sudo chsh -s $(brew --prefix)/bin/bash $USER 2> /dev/null
fi
fi
if [ $DIST = "ubuntu" ]; then
# sudoers
if [ -f /etc/sudoers ] && ( sudo cat /etc/sudoers | grep "env_reset" > /dev/null || sudo cat /etc/sudoers | grep "secure_path" > /dev/null ); then
sudo $DIR/bin/file_remove_str "Defaults[[:space:]]+env_reset" /etc/sudoers
sudo $DIR/bin/file_remove_str "Defaults[[:space:]]+secure_path=\".*\"" /etc/sudoers
fi
# timezone and locale
echo $SYSTEM_TIMEZONE | sudo tee /etc/timezone
sudo dpkg-reconfigure -f noninteractive tzdata
sudo locale-gen $SYSTEM_LOCALE
fi
touch $DIR/tmp/.dotfiles-os-initialised
}
function os_update {
print_h1 "Updating..."
if [ $DIST = "macosx" ]; then
print_h2 "System packages"
$mas_upgrade
print_h2 "Homebrew metadata"
$brew_update
print_h2 "Homebrew packages"
$brew_upgrade
fi
if [ $DIST = "ubuntu" ]; then
print_h2 "System metadata"
$apt_get_update
print_h2 "System packages"
$apt_get_upgrade
fi
}
function os_install_apps {
print_h1 "Installing..."
# install requested bundles
if should_install "utils-bundle" || should_install "all-bundles"; then
run_install utils-bundle
fi
if should_install "developer-bundle" || should_install "all-bundles"; then
run_install developer-bundle
fi
# TODO: Allow to add a new bundle without having to modify the code
if should_install "a2si-bundle"; then
run_install a2si-bundle
fi
if should_install "stefaniuk-bundle"; then
run_install stefaniuk-bundle
fi
# install requested applications
for app in $(find $DIR/lib -maxdepth 1 -type f \( ! -iname "*-bundle" \) -exec basename {} \;); do
install_app $app
done
}
function os_config_apps {
print_h1 "Configuring..."
# config requested bundles
if should_config "utils-bundle" || should_config "all-bundles"; then
run_config utils-bundle
fi
if should_config "developer-bundle" || should_config "all-bundles"; then
run_config developer-bundle
fi
# TODO: Allow to add a new bundle without having to modify the code
if should_config "a2si-bundle"; then
run_config a2si-bundle
fi
if should_config "stefaniuk-bundle"; then
run_config stefaniuk-bundle
fi
# config requested applications
for app in $(find $DIR/lib -maxdepth 1 -type f \( ! -iname "*-bundle" \) -exec basename {} \;); do
config_app $app
done
}
function os_customise {
print_h1 "Customising..."
for task in $(find $DIR/lib/customisations -maxdepth 1 -type f -exec basename {} \;); do
run_customise $task
done
}
function os_test {
/bin/bash -cli "system_test --skip-selected-tests"
}
function install_app {
for app in "$@"; do
should_install $app && run_install $app
done
}
function should_install {
# check if already installed at this run
_is_on_list "$install_already_processed" "$1" && return 1
_is_on_list "$arg_install_apps" "$1"
return $?
}
function run_install {
for app in "$@"; do
([ -f $DIR/lib/$app ] || [ -f $DIR/lib/bundles/$app ]) && (
# source the requested installation script
echo $app | grep -q -- "-bundle$" && . $DIR/lib/bundles/$app $* || . $DIR/lib/$app $*
# check if system specific installation function exists
local func_sys_spec=
if type -t "$DIST-install-$app" | grep -q "^function$"; then
func_sys_spec="$DIST-install-$app"
fi
# check if generic installation function exists
local func_gen=
if type -t "install-$app" | grep -q "^function$"; then
func_gen="install-$app"
fi
# run the installation functions
if [ -n "$func_sys_spec" ] || [ -n "$func_gen" ]; then
echo $app | grep -q -- "-bundle$" && print_h2 $(echo $app | sed 's/-/ /') || print_h3 $app
[ -n "$func_sys_spec" ] && $func_sys_spec $*
[ -n "$func_gen" ] && $func_gen $*
fi
)
install_already_processed="$install_already_processed,$app"
done
}
function config_app {
for app in "$@"; do
should_config $app && run_config $app
done
}
function should_config {
# check if already configured at this run
_is_on_list "$config_already_processed" "$1" && return 1
_is_on_list "$arg_config_apps" "$1" || _is_on_list "$arg_config_apps" "all"
return $?
}
function run_config {
for app in "$@"; do
([ -f $DIR/lib/$app ] || [ -f $DIR/lib/bundles/$app ]) && (
# source the requested configuration script
echo $app | grep -q -- "-bundle$" && . $DIR/lib/bundles/$app $* || . $DIR/lib/$app $*
# check if system specific configuration function exists
local func_sys_spec=
if type -t "$DIST-config-$app" | grep -q "^function$"; then
func_sys_spec="$DIST-config-$app"
fi
# check if generic configuration function exists
local func_gen=
if type -t "config-$app" | grep -q "^function$"; then
func_gen="config-$app"
fi
# run the configuration functions
if [ -n "$func_sys_spec" ] || [ -n "$func_gen" ]; then
echo $app | grep -q -- "-bundle$" && print_h2 $(echo $app | sed 's/-/ /') || print_h3 $app
[ -n "$func_sys_spec" ] && $func_sys_spec $*
[ -n "$func_gen" ] && $func_gen $*
fi
)
config_already_processed="$config_already_processed,$app"
done
}
function run_customise {
for task in "$@"; do
[ -f $DIR/lib/customisations/$task ] && (
# source the requested customisations script
. $DIR/lib/customisations/$task $*
# check if system specific customisations function exists
local func_sys_spec=
if type -t "$DIST-customise-$task" | grep -q "^function$"; then
func_sys_spec="$DIST-customise-$task"
fi
# check if generic customisations function exists
local func_gen=
if type -t "customise-$task" | grep -q "^function$"; then
func_gen="customise-$task"
fi
# run the customisations functions
if [ -n "$func_sys_spec" ] || [ -n "$func_gen" ]; then
print_h3 $task
[ -n "$func_sys_spec" ] && $func_sys_spec $*
[ -n "$func_gen" ] && $func_gen $*
fi
)
done
}
function _app_dir_setup {
sudo mkdir -p $app_dir
sudo chmod 777 $app_dir
}
function _is_on_list {
local list=$1
local item=$2
[ -z "$list" ] && return 1
echo "$list" | grep "^${item}$" > /dev/null 2>&1 && return 0 # is a
echo "$list" | grep "^${item}," > /dev/null 2>&1 && return 0 # starts with
echo "$list" | grep ",${item}$" > /dev/null 2>&1 && return 0 # ends with
echo "$list" | grep ",${item}," > /dev/null 2>&1 && return 0 # contains
return 1
}
################################################################################
# helpers
function print_h1 {
tput setaf 15; tput bold # white bold
printf "$*"
tput sgr 0
printf "\n"
}
function print_h2 {
tput setaf 33; tput bold # blue bold
printf "$*"
tput sgr 0
printf "\n"
}
function print_h3 {
tput setaf 64; tput bold # green bold
printf "$*"
tput sgr 0
printf "\n"
}
function print_err {
(
tput setaf 196 # red
printf "$*"
tput sgr 0
printf "\n"
) >&2
}
################################################################################
function usage {
local file=$(basename $0 2> /dev/null)
printf "\nUsage: ${file} [options]\n"
printf "\nOptions:\n"
printf "\t--config[=all,app1,app2,...]\n"
printf "\t--customise\n"
printf "\t--debug\n"
printf "\t--directory=/dir\n"
printf "\t--extension-man\n"
printf "\t--fix-file-ownership\n"
printf "\t--force-download\n"
printf "\t--force-initialise\n"
printf "\t--help\n"
printf "\t--install={dependencies|system|admin|developer|user}-bundle|all-bundles,app1,app2,...\n"
printf "\t--load-secrets\n"
printf "\t--minimal\n"
printf "\t--offline\n"
printf "\t--sudo\n"
printf "\t--synchronise-only\n"
printf "\t--test\n"
printf "\t--update-os\n"
printf "\t--user=username\n"
printf "\nVariables:\n"
printf "\tBASH_PROMPT_RELOAD_HISTORY=true|yes|on|1|TRUE|YES|ON (default: no)\n"
printf "\tBASH_PROMPT_SHOW_GIT=true|yes|on|1|TRUE|YES|ON (default: yes)\n"
printf "\tBITBUCKET_ACCOUNT=name\n"
printf "\tGITHUB_ACCOUNT=name\n"
printf "\tGITLAB_ACCOUNT=name\n"
printf "\tUSER_EMAIL=user@email (required)\n"
printf "\tUSER_NAME=\"User Name\" (required)\n"
printf "\n"
}
main $*