summaryrefslogtreecommitdiff
path: root/logNotify-lib.sh
diff options
context:
space:
mode:
authorSt33v <github@f3rr3t.com>2026-04-30 14:31:09 +1000
committerSt33v <github@f3rr3t.com>2026-04-30 14:31:09 +1000
commita7072b79f39d2889dbc4032f3cb39e77fd8242c2 (patch)
tree784953c442df1720cb277970ec141a485849eaa8 /logNotify-lib.sh
parent76057b111f43b9617b734bb61d0db6f044254b17 (diff)
log notifyHEADmaster
Diffstat (limited to 'logNotify-lib.sh')
-rw-r--r--logNotify-lib.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/logNotify-lib.sh b/logNotify-lib.sh
index 2941df6..3f98d2f 100644
--- a/logNotify-lib.sh
+++ b/logNotify-lib.sh
@@ -1,8 +1,10 @@
# logging and 'notify-send' functions
# SJP 2 Feb 2026
#
-#
-#!/usr/bin/env bash
+(return 0 2>/dev/null) || {
+ echo "This file is meant to be sourced, not executed." >&2
+ exit 1
+}
APP_NAME="$(basename "${0%% *}")"
JOURNAL_TAG="${APP_NAME%%.*}"
@@ -26,3 +28,11 @@ log() {
# Also notify (best-effort)
notify "$msg"
}
+
+die() {
+ local code=1
+ [[ "$1" =~ ^[0-9]+$ ]] && { code="$1"; shift; }
+ log "ERROR: $*"
+ exit "$code"
+}
+