aurora75735c9
install.sh: install dependencies automaticallyr
+7 −18
2 files changed
- M README.md +0 −5
- M install.sh +7 −13
| @@ -3,11 +3,6 @@ | |||
| 3 | 3 | <img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen.png"> | |
| 4 | 4 | <img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen2.png"> | |
| 5 | 5 | ||
| 6 | − | ## Prerequisites | |
| 7 | − | ```bash | |
| 8 | − | sudo pacman -S git gum stow | |
| 9 | − | ``` | |
| 10 | − | ||
| 11 | 6 | ## Usage | |
| 12 | 7 | ```bash | |
| 13 | 8 | cd $HOME | |
| @@ -41,15 +41,6 @@ if [[ "$EUID" -eq 0 ]]; then | |||
| 41 | 41 | exit 1 | |
| 42 | 42 | fi | |
| 43 | 43 | ||
| 44 | − | ||
| 45 | − | check_install() { | |
| 46 | − | if ! command -v $1 >/dev/null 2>&1; then | |
| 47 | − | echo "$1 is required. Install it first." | |
| 48 | − | exit 1 | |
| 49 | − | fi | |
| 50 | − | } | |
| 51 | − | ||
| 52 | − | ||
| 53 | 44 | choose_packages() { | |
| 54 | 45 | local -n arr=$1 | |
| 55 | 46 | gum choose --no-limit \ | |
| @@ -87,14 +78,17 @@ confirm() { | |||
| 87 | 78 | gum confirm --default=false "$msg" | |
| 88 | 79 | } | |
| 89 | 80 | ||
| 81 | + | install_prerequisites() { | |
| 82 | + | sudo pacman -S --needed --noconfirm stow gum git zsh | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | ||
| 90 | 86 | ################# | |
| 91 | 87 | ## GATEKEEPING ## | |
| 92 | 88 | ################# | |
| 93 | 89 | ||
| 94 | − | ## Add checks for prerequisites | |
| 95 | − | check_install git | |
| 96 | − | check_install gum | |
| 97 | − | check_install stow | |
| 90 | + | ## Installs prerequisites | |
| 91 | + | install_prerequisites | |
| 98 | 92 | ||
| 99 | 93 | currentDir="$(dirname "$(readlink -f "$0")")" | |
| 100 | 94 | cd "$currentDir" | |