auroracdd7d03
install.sh: add check for stow prerequisite
+12 −13
2 files changed
- M README.md +2 −2
- M install.sh +10 −11
| @@ -3,9 +3,9 @@ | |||
| 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 | |
| 6 | + | ## Prerequisites | |
| 7 | 7 | ```bash | |
| 8 | − | sudo pacman -S git gum | |
| 8 | + | sudo pacman -S git gum stow | |
| 9 | 9 | ``` | |
| 10 | 10 | ||
| 11 | 11 | ## Usage | |
| @@ -39,18 +39,17 @@ if [[ "$EUID" -eq 0 ]]; then | |||
| 39 | 39 | fi | |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | − | ## Check if gum is installed | |
| 43 | − | if ! command -v gum >/dev/null 2>&1; then | |
| 44 | − | echo "gum is required. Install it first." | |
| 45 | − | exit 1 | |
| 46 | − | fi | |
| 47 | − | ||
| 48 | − | ## Check if git is installed | |
| 49 | − | if ! command -v git >/dev/null 2>&1; then | |
| 50 | − | echo "git is required. Install it first." | |
| 51 | − | exit 1 | |
| 52 | − | fi | |
| 42 | + | check_install() { | |
| 43 | + | if ! command -v $1 >/dev/null 2>&1; then | |
| 44 | + | echo "$1 is required. Install it first." | |
| 45 | + | exit 1 | |
| 46 | + | fi | |
| 47 | + | } | |
| 53 | 48 | ||
| 49 | + | ## Add checks for prerequisites | |
| 50 | + | check_install git | |
| 51 | + | check_install gum | |
| 52 | + | check_install stow | |
| 54 | 53 | ||
| 55 | 54 | currentDir="$(dirname "$(readlink -f "$0")")" | |
| 56 | 55 | cd "$currentDir" | |