mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
critical handles the exit
This commit is contained in:
parent
ad437c4030
commit
a30b559509
2 changed files with 3 additions and 7 deletions
|
@ -394,8 +394,7 @@ then
|
||||||
authorised_user="$(cat "$setup_user_file")"
|
authorised_user="$(cat "$setup_user_file")"
|
||||||
if [ "$(whoami)" != "$authorised_user" ]
|
if [ "$(whoami)" != "$authorised_user" ]
|
||||||
then
|
then
|
||||||
echo -e "\e[91mThis script need to be executed by the user $setup_user_file !\nThe current user is $(whoami).\e[0m"
|
critical "This script need to be executed by the user $setup_user_file !\nThe current user is $(whoami)."
|
||||||
clean_exit 1
|
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "\e[93mUnable to define the user who authorised to use package check. Please fill the file $setup_user_file\e[0m"
|
echo -e "\e[93mUnable to define the user who authorised to use package check. Please fill the file $setup_user_file\e[0m"
|
||||||
|
@ -436,9 +435,7 @@ then
|
||||||
# If lxc's not installed and build_lxc set. Asks to build the container.
|
# If lxc's not installed and build_lxc set. Asks to build the container.
|
||||||
build_lxc=2
|
build_lxc=2
|
||||||
else
|
else
|
||||||
critical "LXC is not installed or the container $lxc_name doesn't exist."
|
critical "LXC is not installed or the container $lxc_name doesn't exist.\nUse the script 'lxc_build.sh' to fix them."
|
||||||
critical "Use the script 'lxc_build.sh' to fix them."
|
|
||||||
clean_exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
elif [ $build_lxc -eq 1 ]
|
elif [ $build_lxc -eq 1 ]
|
||||||
|
@ -515,7 +512,6 @@ then
|
||||||
gitbranch="-b stable"
|
gitbranch="-b stable"
|
||||||
else
|
else
|
||||||
critical "Unable to find a default branch to test (master or stable)"
|
critical "Unable to find a default branch to test (master or stable)"
|
||||||
clean_exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
@ -531,7 +527,6 @@ fi
|
||||||
# Check if the package directory is really here.
|
# Check if the package directory is really here.
|
||||||
if [ ! -d "$package_path" ]; then
|
if [ ! -d "$package_path" ]; then
|
||||||
critical "Unable to find the directory $package_path for the package..."
|
critical "Unable to find the directory $package_path for the package..."
|
||||||
clean_exit 1
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ function error()
|
||||||
function critical()
|
function critical()
|
||||||
{
|
{
|
||||||
echo "${BOLD}${RED}Critical: ${1}${NORMAL}" | tee -a "$complete_log" 2>&1
|
echo "${BOLD}${RED}Critical: ${1}${NORMAL}" | tee -a "$complete_log" 2>&1
|
||||||
|
clean_exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function report_test_success () {
|
function report_test_success () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue