-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·44 lines (38 loc) · 1.33 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·44 lines (38 loc) · 1.33 KB
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
# Load each of the tools.
for file in ./tools/*; do
[ -e "$file" ] || continue
echo "Loading tool '$file'..."
source "$file"
done
# Get the operating system, output it. The script will terminate if the OS
# cannot be categorically identified.
os=$(get_os)
echo "os identified as: $os"
# Run each of the setup files.
for file in ./setup.d/*; do
# If we don't have a file (this happens when we find no results), then just
# move onto the next file (or finish the loop).
[ -e "$file" ] || continue
# Ask the user if they want to setup the feature, then setup or skip.
feature=$(basename "$file")
if ! ask "$os: setup feature '$feature'?" "N"; then continue; fi
source $file
done
# Many changes (such as chsh) need a restart, offer it now,
if ask "$os: Some changes may require a restart - restart now?" N; then
if [[ "$os" == "osx" ]]; then
echo "$os: Restarting..."
sudo shutdown -r now
elif [[ "$os" == "ubuntu" ]]; then
echo "$os: Restarting..."
echo "TODO"
fi
fi
# Ask whether a restore of private files is needed.
if ask "$os: configure AWS_PROFILE and restore private files?" "N"; then
make private-files-restore
fi
# Update the remote.
if ask "$os: update dotfiles remote to ssh?" "N"; then
git remote set-url origin "git@github.com:dwmkerr/dotfiles.git"
fi