-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-system.sh
executable file
·56 lines (43 loc) · 1.86 KB
/
install-system.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
#!/bin/sh
set -o errexit
set -o nounset
echo "==> system installation started"
PROJECT_ROOT=$(git rev-parse --show-toplevel)
# shellcheck source=lib/copy.sh
. "$PROJECT_ROOT/lib/copy.sh"
# shellcheck source=lib/make_directory.sh
. "$PROJECT_ROOT/lib/make_directory.sh"
# shellcheck source=lib/link.sh
. "$PROJECT_ROOT/lib/link.sh"
# shellcheck source=lib/prompt.sh
. "$PROJECT_ROOT/lib/prompt.sh"
# shellcheck source=lib/remove.sh
. "$PROJECT_ROOT/lib/remove.sh"
# Remove unnecessary/redundant files
echo
echo "--> Removing redundant/unnecessary files..."
FILES="$PROJECT_ROOT/files"
if prompt "Install Chrome repositories? (y/N)"; then
make_directory "/etc/apt/preferences.d"
copy "$FILES/etc/apt/preferences.d/google-chrome" "/etc/apt/preferences.d/google-chrome"
make_directory "/etc/apt/sources.list.d"
copy "$FILES/etc/apt/sources.list.d/google-chrome.list" "/etc/apt/sources.list.d/google-chrome.list"
make_directory "/etc/default"
copy "$FILES/etc/default/google-chrome" "/etc/default/google-chrome"
make_directory "/usr/local/share/keyrings"
copy "$FILES/usr/local/share/keyrings/google-chrome.gpg" "/usr/local/share/keyrings/google-chrome.gpg"
else
remove "/etc/apt/sources.list.d/google-chrome.list"
fi
if prompt "Install Microsoft Visual Studio Code repositories? (y/N)"; then
make_directory "/etc/apt/preferences.d"
copy "$FILES/etc/apt/preferences.d/microsoft-vscode" "/etc/apt/preferences.d/microsoft-vscode"
make_directory "/etc/apt/sources.list.d"
copy "$FILES/etc/apt/sources.list.d/microsoft-vscode.list" "/etc/apt/sources.list.d/microsoft-vscode.list"
make_directory "/usr/local/share/keyrings"
copy "$FILES/usr/local/share/keyrings/microsoft.gpg" "/usr/local/share/keyrings/microsoft.gpg"
else
remove "/etc/apt/sources.list.d/microsoft-vscode.list"
fi
echo
echo "==> system installation completed successfully"