-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathupdate.sh
executable file
·55 lines (45 loc) · 978 Bytes
/
update.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
#!/usr/bin/env bash
# TODO:
# - macOS: trigger system and app update
# - Node: npm updates (node -v, npm -v)
# cd & check
if ! cd "$(dirname "$0")"; then exit; fi
# Use absolute paths
DOTFILES_ROOT="$(pwd)"
# Option defaults
INSTALL_UPDATES=false
CLEAN_UP=true
# Show usage information
usage() {
echo "Usage: $0 [-i|--install] [-h|--help]"
echo " -h, --help Show this help message and exit"
echo " -i, --install Install updates"
}
# Handle command-line options
while test $# -gt 0; do
case "$1" in
-h | --help)
usage
exit
;;
-i | --install) INSTALL_UPDATES=true ;;
*)
echo "Unknown argument: $1"
usage
exit 1
;;
esac
shift
done
# Exit immediately if a command returns a non-zero status
set -e
# Load helper functions
source "${DOTFILES_ROOT}/helper.sh"
source "${DOTFILES_ROOT}/helper_update.sh"
# Start
title "Start update"
show_options
ask_to_start
update_homebrew
update_ruby
# update_python