From d97185c5e8b8d2cd05b396c278b731327fb6936c Mon Sep 17 00:00:00 2001 From: pvincent Date: Tue, 14 Jul 2026 10:28:38 +0400 Subject: [PATCH] source/file not found done --- bin/miaou-bash | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/bin/miaou-bash b/bin/miaou-bash index 73d4528..4baa463 100755 --- a/bin/miaou-bash +++ b/bin/miaou-bash @@ -96,9 +96,18 @@ function on_exit { else regex='^(.*): No such file or directory$' if [[ "$message" =~ $regex ]]; then - #TODO: SOURCE_NOT_FOUND or FILE_NOT_FOUND - failure_type='SOURCE NOT FOUND' - failure_payload="${BASH_REMATCH[1]} line=${line}" + failure_payload="${BASH_REMATCH[1]}" + if [[ $code == 1 ]]; then + failure_type='SOURCE NOT FOUND' + stack_lines[0]=$line + else + if [[ $code == 127 ]]; then + failure_type='FILE NOT FOUND' + # TODO: print a warning hint in stderr like so: prefer source rather than subshell + else + failure_type='UNKNOWN NOT FOUND' + fi + fi else failure_type='UNKNOWN' failure_payload="${message}"