feat(auto update): add utility function to exit on error
Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit is contained in:
parent
b089c6182b
commit
e1d6ab87f6
10
scripts/updates/utils/termux_error_exit.sh
Normal file
10
scripts/updates/utils/termux_error_exit.sh
Normal file
@ -0,0 +1,10 @@
|
||||
# shellcheck shell=bash
|
||||
termux_error_exit() {
|
||||
if [ "$#" -eq 0 ]; then
|
||||
# Read from stdin.
|
||||
printf '%s\n' "$(cat)" >&2
|
||||
else
|
||||
printf '%s\n' "$*" >&2
|
||||
fi
|
||||
exit 1
|
||||
}
|
Loading…
Reference in New Issue
Block a user