New commits:
commit 2f9d32099e46cfd5090f53d9d0ced9c51d0ed5ba
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
cauldron: handle corner cases in REPL
Perform better error checking and present more understandable error
messages if the user attempts to set environment variables or call
non-existent commands/functions.
diff --git a/cauldron/bin/cauldron b/cauldron/bin/cauldron
index ffa0f37..3aa6e46 100755
--- a/cauldron/bin/cauldron
+++ b/cauldron/bin/cauldron
@@ -739,7 +739,20 @@ function command_shell() {
if ! get_command -t "$input"
then
+ # check if the user is trying to set a shell variable
+ case "$input" in
+ *=*)
+ libcolor_msg warn "this REPL does not support setting variables"
+ continue
+ ;;
+ esac
# attempt to run the command through the regular shell as a backup
+ if ! command -v $input >/dev/null
+ then
+ echo "$cmd"
+ libcolor_msg error "command not found: $input"
+ continue
+ fi
$input
input=""
continue
@@ -779,7 +792,7 @@ function get_command() {
return 1
fi
- if ! declare -lF "$cmd"
+ if ! command -v "$cmd" >/dev/null
then
return 1
fi
[[SM-Commit] ] GIT changes to master cauldron by Justin Boffemmyer (2f9d32099e46cfd5090f53d9d0ced9c51d0ed5ba),
Justin Boffemmyer, 03/15/2025