Skip to content

Commit 05b9c72

Browse files
committed
Merge pull request #36 from ash-shell/br.test
Return module not found on dispatch
2 parents 58c83a5 + 9506e29 commit 05b9c72

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ash

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ Ash_dispatch() {
202202
for part in "${segment[@]}"; do
203203
if [[ "$position" -eq 1 ]]; then
204204
Ash_load_callable_file "$part"
205+
if [[ $? -ne 0 ]]; then
206+
Logger__error "Module '$part' is unknown"
207+
return
208+
fi
205209
Ash__import "$part" "1"
206210
elif [[ "$position" -eq 2 ]]; then
207211
Ash_execute_callable "$part" "${@:2}"
@@ -236,8 +240,7 @@ Ash_load_callable_file() {
236240
# Updating Logger's prefix
237241
Logger__set_prefix "$Ash_module_config_name"
238242
else
239-
Logger__error "Module '$part' is unknown"
240-
exit
243+
return 1
241244
fi
242245
}
243246

0 commit comments

Comments
 (0)