source/file not found done

This commit is contained in:
pvincent
2026-07-14 10:28:38 +04:00
parent 80c3fce399
commit d97185c5e8
+11 -2
View File
@@ -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_payload="${BASH_REMATCH[1]}"
if [[ $code == 1 ]]; then
failure_type='SOURCE NOT FOUND'
failure_payload="${BASH_REMATCH[1]} line=${line}"
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}"