Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scripts/keyless_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,18 @@ export FOUNDRY_DISABLE_NIGHTLY_WARNING=1 # Suppress foundry nightly warning

# Check required commands
MISSING=()
for cmd in cast jq python3 "$MEGA_EVME"; do
for cmd in cast jq python3; do
if ! command -v "$cmd" &>/dev/null; then
MISSING+=("$cmd")
fi
done

# Check mega-evme binary separately (handle args)
MEGA_EVME_BIN=${MEGA_EVME%% *}
if ! command -v "$MEGA_EVME_BIN" &>/dev/null; then
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existence check fix is correct here — extracting the binary name via ${MEGA_EVME%% *} handles the case where MEGA_EVME contains arguments.

However, the actual invocation on line 101 still uses "$MEGA_EVME" (double-quoted), which means if MEGA_EVME="mega-evme --some-flag", bash will try to execute the entire string as a single command name rather than splitting it into command + arguments. So the scenario this PR fixes for the existence check would still fail at runtime.

To make this work end-to-end, line 101 should use $MEGA_EVME unquoted (to allow word splitting) or use an array-based approach:

Suggested change
if ! command -v "$MEGA_EVME_BIN" &>/dev/null; then
if ! command -v "$MEGA_EVME_BIN" &>/dev/null; then

And then also change line 101 from "$MEGA_EVME" to $MEGA_EVME (unquoted) so that arguments are properly word-split.

MISSING+=("$MEGA_EVME_BIN")
fi

if [ ${#MISSING[@]} -ne 0 ]; then
echo "ERROR: Required command(s) not found: ${MISSING[*]}"
echo "Please install them before running this script."
Expand Down
Loading