install.sh: add check for stow prerequisite
This commit is contained in:
parent
38e5a0be3b
commit
cdd7d036c7
|
|
@ -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
|
||||
|
|
|
|||
17
install.sh
17
install.sh
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue