Skip to content

Commit 64f0181

Browse files
committed
feat: Add core.print_die function
A simple die function is essential across all Basalt programs
1 parent affa474 commit 64f0181

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pkg/src/public/bash-core.sh

+7
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,13 @@ core.print_info_fn() {
327327
printf '%s\n' "Info: ${FUNCNAME[1]}${msg:+": "}$msg"
328328
}
329329

330+
# @description Print a error message to standard error and die
331+
# @arg $1 string message
332+
core.print_die() {
333+
core.print_error "$1"
334+
exit 1
335+
}
336+
330337
# @description Print an error message to standard error
331338
# @arg $1 string message
332339
core.print_error() {

0 commit comments

Comments
 (0)