-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·75 lines (64 loc) · 1.44 KB
/
install.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
#!/bin/bash
# cd & check
if ! cd "$(dirname "$0")"; then exit; fi
# use absolute paths
DOTFILES_ROOT="$(pwd)"
# option defaults
INSTALL_SOFTWARE=false
INSTALL_CONFIG=true
OVERWRITE_EXISTING_CONFIG=true
BACKUP_EXISTING_CONFIG=true
BACKUP_EXISTING_CONFIG_LINK=false
SKIP_EXISTING_CONFIG=true
OPTION_DRYRUN=false
# handle command-line options
while :; do
case "$1" in
--software) INSTALL_SOFTWARE=true ;;
--no-software) INSTALL_SOFTWARE=false ;;
--config) INSTALL_CONFIG=true ;;
--no-config) INSTALL_CONFIG=false ;;
--overwrite) OVERWRITE_EXISTING_CONFIG=true ;;
--no-overwrite) OVERWRITE_EXISTING_CONFIG=false ;;
--backup) BACKUP_EXISTING_CONFIG=true ;;
--no-backup) BACKUP_EXISTING_CONFIG=false ;;
--dry-run) OPTION_DRYRUN=true ;;
*) break ;;
esac
shift
done
# parameters
BACKUP_TIMESTAMP="$(date '+%Y%m%d-%H%M%S')"
# Exit immediately if a command returns a non-zero status
set -e
# load helper functions
source "${DOTFILES_ROOT}/helper.sh"
# start
title "Start installation"
show_options
ask_to_start
# install software
if [[ "$INSTALL_SOFTWARE" == "true" ]]; then
title "Install Software"
install_xcode_cli
install_homebrew
fi
# link configs and install dependencies
if [[ "$INSTALL_CONFIG" == "true" ]]; then
title "Install Configurations"
use_bin
use_git
use_ssh
use_zsh
#use_bash
use_tmux
use_fd
use_vim
use_neovim
use_kitty
use_lazygit
use_httpie
use_fzf
fi
echo ""
info "Finished"