install.sh: install dependencies automaticallyr
This commit is contained in:
parent
bff4e782e1
commit
75735c9873
|
|
@ -3,11 +3,6 @@
|
||||||
<img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen.png">
|
<img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen.png">
|
||||||
<img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen2.png">
|
<img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen2.png">
|
||||||
|
|
||||||
## Prerequisites
|
|
||||||
```bash
|
|
||||||
sudo pacman -S git gum stow
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
```bash
|
```bash
|
||||||
cd $HOME
|
cd $HOME
|
||||||
|
|
|
||||||
20
install.sh
20
install.sh
|
|
@ -41,15 +41,6 @@ if [[ "$EUID" -eq 0 ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
check_install() {
|
|
||||||
if ! command -v $1 >/dev/null 2>&1; then
|
|
||||||
echo "$1 is required. Install it first."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
choose_packages() {
|
choose_packages() {
|
||||||
local -n arr=$1
|
local -n arr=$1
|
||||||
gum choose --no-limit \
|
gum choose --no-limit \
|
||||||
|
|
@ -87,14 +78,17 @@ confirm() {
|
||||||
gum confirm --default=false "$msg"
|
gum confirm --default=false "$msg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_prerequisites() {
|
||||||
|
sudo pacman -S --needed --noconfirm stow gum git zsh
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
## GATEKEEPING ##
|
## GATEKEEPING ##
|
||||||
#################
|
#################
|
||||||
|
|
||||||
## Add checks for prerequisites
|
## Installs prerequisites
|
||||||
check_install git
|
install_prerequisites
|
||||||
check_install gum
|
|
||||||
check_install stow
|
|
||||||
|
|
||||||
currentDir="$(dirname "$(readlink -f "$0")")"
|
currentDir="$(dirname "$(readlink -f "$0")")"
|
||||||
cd "$currentDir"
|
cd "$currentDir"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue