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:
Aditya Alok 2022-03-26 12:47:54 +05:30
parent b089c6182b
commit e1d6ab87f6
1 changed files with 10 additions and 0 deletions

View 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
}