-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·76 lines (60 loc) · 2.19 KB
/
install
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
#!/usr/bin/env bash
#
# Basic setup
#
# Define toolbox directory if not set
if [ -z "$TOOLBOX" ]; then
TOOLBOX="$HOME/.exolnet/toolbox"
fi
# Check if toolbox directory exists
if [ ! -d "$TOOLBOX" ]; then
echo "Directory ~/.exolnet does not exists, exiting ..."
exit 1
fi
# Source helpers
. "$TOOLBOX/lib/include"
#
# Script checks
#
# Check if homebrew shell environment variables are defined
if [[ -z "$HOMEBREW_PREFIX" ]]; then
echo
echo "Homebrew environment variables are missing."
echo "They must be present in your shell profile in order for this script to run."
exit 1
fi
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo
echo "The command \"$(basename "$0")\" should not be executed as root or via sudo directly."
echo "When a command requires root access, you will be prompted for a password as needed."
exit 1
fi
#
# Script execution
#
# Mark that we were here
MAIN_INSTALL_SCRIPT=true
# Command Line Tools and Homebrew are installed in bootstrap script
e_header "Installing dependencies"
brew_install dialog
e_header "Installing scripts"
process_recursive "link_file" "$TOOLBOX/bin" "$HOMEBREW_PREFIX/bin"
e_header "Configuring system preferences"
safe_execute "increase_sudo_timeout" "Increased sudo timeout to 60 minutes" "Failed to increase sudo timeout to 60 minutes"
safe_execute "enable_sudo_touch_id" "Enabled touch id support for sudo" "Failed to enable touch id support for sudo"
safe_execute "enable_full_keyboard_access" "Enabled full keyboard access" "Failed to enable full keyboard access"
safe_execute "enable_show_all_file_name_extensions" "Enabled show all file name extensions" "Failed to enable show all file name extensions"
e_header "Creating storage directories"
create_directory "$STORAGE_PREFERENCES_DIR"
create_directory "$STORAGE_MIGRATIONS_DIR"
e_header "Skipping migrations"
MIGRATIONS=$(ls "$MIGRATIONS_DIR" 2> /dev/null)
for migration in $MIGRATIONS; do
if [ ! -e "$STORAGE_MIGRATIONS_DIR/$migration" ]; then
touch "$STORAGE_MIGRATIONS_DIR/$migration"
e_success "Marked migration $migration as already applied"
fi
done
. "$TOOLBOX/bin/exo-software-select"
. "$TOOLBOX/bin/exo-software-install"