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/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
|
## Prerequisites
|
||||||
```bash
|
```bash
|
||||||
sudo pacman -S git gum
|
sudo pacman -S git gum stow
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
|
||||||
21
install.sh
21
install.sh
|
|
@ -39,18 +39,17 @@ if [[ "$EUID" -eq 0 ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
## Check if gum is installed
|
check_install() {
|
||||||
if ! command -v gum >/dev/null 2>&1; then
|
if ! command -v $1 >/dev/null 2>&1; then
|
||||||
echo "gum is required. Install it first."
|
echo "$1 is required. Install it first."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
## Check if git is installed
|
|
||||||
if ! command -v git >/dev/null 2>&1; then
|
|
||||||
echo "git 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")")"
|
currentDir="$(dirname "$(readlink -f "$0")")"
|
||||||
cd "$currentDir"
|
cd "$currentDir"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue