-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·72 lines (61 loc) · 1.92 KB
/
install.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
#!/usr/bin/env bash
. "./shell/src/ask.sh"
. "./shell/src/print.sh"
. "./shell/src/should_install.sh"
. "./shell/src/install_scripts.sh"
. "./shell/src/install_pkgs.sh"
. "./shell/src/install_configs.sh"
. "./shell/src/use_tzdata.sh"
. "./shell/src/use_brew.sh"
. "./shell/src/use_stow.sh"
. "./shell/src/use_flatpak.sh"
# Tell that the script is sourcing src
# TODO: remove it after refactoring to import src files manually
echo "Sourcing helper files..."
for file in shell/src/*; do
if [ -f "$file" ]; then
# shellcheck disable=SC1090
. "$file" # Source the file
fi
done
# TODO: check if any of the params are -d not only the first one
# Check if -d flag is passed and source declarative install script
if [ "$1" = "-d" ]; then
. "./declarative.sh"
fi
# Tell what is going to happen
print "# -------------- castrozan:dotfiles install script ---------------\n" "$_MAGENTA" "$_BOLD"
print "Some packages are required to run the install script.\n" "$_YELLOW" "$_BOLD"
if ask "Do you want to install them?"; then
should_install build-essential
should_install curl
should_install git
use_tzdata
use_flatpak
use_brew
use_stow
fi
print "\n"
# Ask if pkgs should be installed
if ask "Do you want to install pkgs?"; then
install_pkgs
fi
print "\n"
# Ask if scripts should be installed
if ask "Do you want to install scripts?"; then
install_scripts
fi
print "\n"
# Ask if configs should be sourced
if ask "Do you want to $_SH to source files?"; then
install_configs
fi
print "\n"
# End of script
print "# ------------------------ End of script ------------------------\n" "$_MAGENTA" "$_BOLD"
# Final reminder to the user
print "To apply changes to your current shell session, run:\n" "$_GREEN" "$_BOLD"
print "git reset --hard origin/main\n" "$_GREEN" "$_BOLD"
print "source ~/.bashrc\n" "$_GREEN" "$_BOLD"
# Cutely tell goodbye
print "( ੭ ˘ ³˘)੭°。⋆♡‧₊˚ bye!\n" "$_CYAN"