mirror of
https://github.com/the-sane/lug-helper.git
synced 2025-01-30 18:59:02 +00:00
Output errors to stderr
This commit is contained in:
parent
82c5ccbbab
commit
37762b9075
@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
# Check for dependencies
|
# Check for dependencies
|
||||||
if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v basename)" ]; then
|
if [ ! -x "$(command -v mktemp)" ] || [ ! -x "$(command -v basename)" ]; then
|
||||||
echo -e "One or more required packages were not found on this system.\nPlease check that the following packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)"
|
echo -e "lug-helper.sh: One or more required packages were not found on this system.\nPlease check that the following packages are installed:\n- mktemp (part of gnu coreutils)\n- basename (part of gnu coreutils)" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -114,12 +114,13 @@ debug_echo() {
|
|||||||
echo -e "\n$2\n"
|
echo -e "\n$2\n"
|
||||||
;;
|
;;
|
||||||
"exit")
|
"exit")
|
||||||
echo -e "\n$2"
|
# Write an error to stderr and exit
|
||||||
|
echo -e "lug-helper.sh: $2" 1>&2
|
||||||
read -n 1 -s -p "Press any key..."
|
read -n 1 -s -p "Press any key..."
|
||||||
exit 0
|
exit 1
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "\nScript error: Unknown argument provided to debug_echo function. Aborting."
|
echo -e "lug-helper.sh: Unknown argument provided to debug_echo function. Aborting." 1>&2
|
||||||
read -n 1 -s -p "Press any key..."
|
read -n 1 -s -p "Press any key..."
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user