Print conficting script warning only if running in a terminal.

This commit is contained in:
2022-12-19 00:37:11 +01:00
parent ffc7fe5f5b
commit d7c2749ef5
3 changed files with 40 additions and 15 deletions

View File

@@ -115,6 +115,14 @@ ok (){
fi
}
warn_only_terminal () {
if $terminal ; then
echo ""
echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*"
echo ""
fi
}
blank_line() {
if $terminal ; then
echo ""
@@ -198,11 +206,9 @@ if [[ ${#CONFLICTING_SCRIPTS} -gt 0 ]] ; then
if $_stop_running ; then
echo ""
echo "[ Error ]: The \"${_script_name}\" script is currently running, but it conflicts with this script."
echo ""
echo " Exiting now.."
echo ""
warn_only_terminal "\033[1m${_script_name}\033[m is currently running, but it conflicts with this script.
Exiting now.."
clean_up 1