install.sh: add check for stow prerequisite

This commit is contained in:
krolxon 2026-01-08 12:50:05 +05:30
parent 38e5a0be3b
commit cdd7d036c7
2 changed files with 12 additions and 13 deletions

View File

@ -3,9 +3,9 @@
<img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen.png">
<img src="https://github.com/krolyxon/dotfiles/blob/master/assets/fullscreen2.png">
## prerequisites
## Prerequisites
```bash
sudo pacman -S git gum
sudo pacman -S git gum stow
```
## Usage

View File

@ -39,18 +39,17 @@ if [[ "$EUID" -eq 0 ]]; then
fi
## Check if gum is installed
if ! command -v gum >/dev/null 2>&1; then
echo "gum is required. Install it first."
exit 1
fi
## Check if git is installed
if ! command -v git >/dev/null 2>&1; then
echo "git is required. Install it first."
check_install() {
if ! command -v $1 >/dev/null 2>&1; then
echo "$1 is required. Install it first."
exit 1
fi
}
## Add checks for prerequisites
check_install git
check_install gum
check_install stow
currentDir="$(dirname "$(readlink -f "$0")")"
cd "$currentDir"