Add Display Functionality
This commit is contained in:
parent
53eba288b3
commit
d816c93c30
1 changed files with 26 additions and 4 deletions
30
install.sh
30
install.sh
|
|
@ -23,7 +23,7 @@ function styleColor {
|
|||
function styleColorRst {
|
||||
echo -e "\e[0m"
|
||||
}
|
||||
function styleTitle {
|
||||
function displayTitle {
|
||||
# Arguments
|
||||
title=$1
|
||||
|
||||
|
|
@ -34,11 +34,33 @@ function styleTitle {
|
|||
bars="${bars}-"
|
||||
done
|
||||
bars="${bars}+"
|
||||
echo -e "\t${bars}"
|
||||
echo -e "\n\n\t${bars}"
|
||||
echo -e "\t| $(styleColor "purple")${title}$(styleColorRst) |"
|
||||
echo -e "\t${bars}"
|
||||
echo -e "\t${bars}\n\n"
|
||||
}
|
||||
function displayQuestion {
|
||||
printf>&2 "$(styleColor "blue")$1$(styleColorRst) $(styleColor "cyan")[$2]$(styleColorRst): "
|
||||
read -r response
|
||||
echo ${response}
|
||||
}
|
||||
function displayYesNo {
|
||||
response=$(displayQuestion "$1" "y/N")
|
||||
if [ "$response" == "y" ] || [ "$response" == "Y" ]; then
|
||||
echo "yes"
|
||||
else
|
||||
echo "no"
|
||||
fi
|
||||
}
|
||||
# Packages
|
||||
|
||||
# --- Entry Point ---
|
||||
styleTitle "OBJNULL Dotfile Installer"
|
||||
clear
|
||||
displayTitle "OBJNULL Dotfile Installer"
|
||||
|
||||
echo -e "This script is designed to quickly install any required components"
|
||||
echo -e "so that your system is up and running quick with a speedy shell.\n"
|
||||
|
||||
response=$(displayYesNo "Continue")
|
||||
if [ ${response} != "yes" ]; then
|
||||
echo -e "$(styleColor "red")Goodbye...$(styleColorRst)"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in a new issue