Browse Source

Add jat__die() suicide pill

Alois Mahdal 6 years ago
parent
commit
5acc359e0d
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      src/jat.sh.skel

+ 13
- 0
src/jat.sh.skel View File

266
     esac
266
     esac
267
 }
267
 }
268
 
268
 
269
+jat__die() {
270
+    #
271
+    # Log error $1 and exit this script abruptly
272
+    #
273
+    local msg
274
+    local msgs=()
275
+    for msg in "$@"; do
276
+        msgs+=("fatal: $msg")
277
+    done
278
+    jat__log_error "${msgs[@]}"
279
+    die "${msgs[@]}"
280
+}
281
+
269
 jat__eval() {
282
 jat__eval() {
270
     #
283
     #
271
     # Assert that code $1 exits with zero (or other)
284
     # Assert that code $1 exits with zero (or other)