mirror of
https://github.com/Lissy93/dotfiles.git
synced 2024-11-24 16:33:14 +01:00
Adds a check to ensure required modules are installed
This commit is contained in:
parent
8a9eb8a2ca
commit
4264d830e6
21
install.sh
21
install.sh
@ -2,6 +2,7 @@
|
||||
|
||||
# Variables
|
||||
CYAN_BOLD='\033[1;96m'
|
||||
YELLOW_BOLD='\033[1;93m'
|
||||
RED_BOLD='\033[1;31m'
|
||||
PLAIN_BOLD='\033[1;37m'
|
||||
|
||||
@ -15,6 +16,26 @@ printf "${CYAN_BOLD}"
|
||||
printf "│\n"
|
||||
printf "╰──────────────────────╯\n"
|
||||
|
||||
# Checks if a given package is installed
|
||||
command_exists () {
|
||||
hash "$1" 2> /dev/null
|
||||
}
|
||||
|
||||
# Shows warning if required modules are missing
|
||||
system_verify () {
|
||||
|
||||
if ! command_exists $1; then
|
||||
printf "${YELLOW_BOLD}Warning:"
|
||||
printf "${PLAIN_BOLD} $1 is not installed\n"
|
||||
fi
|
||||
}
|
||||
|
||||
system_verify "zsh"
|
||||
system_verify "vim"
|
||||
system_verify "git"
|
||||
system_verify "tmux"
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
CONFIG=".install.conf.yaml"
|
||||
|
Loading…
Reference in New Issue
Block a user