-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·99 lines (71 loc) · 2.45 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
#!/usr/bin/env zsh
#
# 'setup.sh' is understood as a startup by GitHub Codespaces and other VMs
# Set Dotfiles home to be the folder in which `setup.sh` was run (requires ZSH)
export DOTFILES_ROOT=${0:a:h}
# This script will run either the Linux or macOS installer
if [[ $OSTYPE == darwin* ]]; then
source $DOTFILES_ROOT/Mac/dotfiles.sh
else
source $DOTFILES_ROOT/Linux/dotfiles.sh
fi
exit 0
# ==============================================================================
#### Saved script tidbits may want later
# This is the name of the actual file that was run (don't need it)
# DOTFILES_SETUP_FILE=${0:a}
# This piece of script would require that you launch the setup while
# already located inside the ~/dotfiles folder - this isn't needed
#
# if [ "$(basename "$PWD")" != "dotfiles" ]; then
# echo "ABORT" "You must run the installer from within the dotfiles folder"
# exit 0
# fi
# Check if the file exists to enforce install from $HOME/dotfiles
#
# if [[ -f "$HOME/dotfiles/setup.sh" ]]; then
# echo
# else
# echo
# echo "~/dotfiles/setup.sh does NOT exist."
# echo "You must install \"dotfiles\" at the root of your home folder."
# echo
# exit 0
# fi
#
#
# Ask to enter a key to continue
# read -s -k $'?Press any key to continue. Hit Control-C to abort now.\n'
#
# Handle parameters from the command line - e.g. "update"
# if [ "$1" = "install" ]; then
# echo "\nDOT.SH: Attempting initial install of the dotfiles..."
#
#
# Diagnostic - delete later
# echo "$(basename "$PWD")"
# echo "$PWD"
#
# First make sure the installer is run from within the ~/dotfiles folder
# if [ "$PWD" != "$HOME/dotfiles" ]; then
# echo " - ABORT: You must install from within the ~./dotfiles folder"
# exit 0
# fi
# fi
# If there were no parameters, explain how to use the tool
# if [ $# -eq 0 ]; then
# echo "DOT.SH: Attempting to update (no parameters). Usage syntax:"
# echo " - dot.sh reset"
# echo " - dot.sh update"
# echo " - dot.sh install (must be run from within ~/dotfiles"
#fi
# If no parameters, or had entered `update` then proceed to update
# if [[ "$1" = "update" || $# -eq 0 ]]; then
# echo "\nDOT.SH: Updating..."
# Verify that the install had previously succeeded
# fi
# First make sure the installer is run from within the dotfiles folder
# if [ "$(basename "$PWD")" != "dotfiles" ]; then
# error "ABORT" "You must run the installer from within the dotfiles folder"
# exit 0
# fi