Skip to content

fix(exec): relative paths from another folder no longer skip the plan rule - #795

Merged
MendixMau merged 1 commit into
masterfrom
claude/exec-relative-paths
Nov 17, 2026
Merged

MendixMau merged 1 commit into
masterfrom
claude/exec-relative-paths

Conversation

@MendixMau

Copy link
Copy Markdown
Owner

What

project-bin/exec.sh set _XD="${0%/*}", which stays relative (e.g. ../../bin), and then ran cd "$PROJECT_ROOT". After the cd, the plan-rule guard [ -f "$_XD/_position.sh" ] silently failed. The whole unattended plan rule was skipped, so a model write before build-ready went ahead.

Repro on master: a two-app scaffold with Interview mode: auto, then cd apps/Orders && bash ../../bin/exec.sh ../../mdlsource/x.mdl. That call is not refused; the same call by absolute path is.

The fix: just before the cd, and only when $PWD is not the project root, _XD and a relative MDL script path are made absolute. The same bug class also broke the later [ -f "$SCRIPT" ] guards (build-plan, Marketplace, restate, scan, look-ledger owe), and those now work too. A run from the project root skips the new block, so its behaviour is unchanged.

Evidence

The commit is cherry-picked from #789's branch (b2546d8). The #789-only part (an in-app bin/ install) stays in #789.


Generated by Claude Code

…after the cd

_XD="${0%/*}" stayed relative (../../bin); after exec.sh's cd to the project root the guard
[ -f "$_XD/_position.sh" ] failed in silence, so 'cd apps/Orders && ../../bin/exec.sh
../../mdlsource/x.mdl' wrote under Interview mode: auto while the same call by absolute path
was refused. A relative MDL script path broke every [ -f "$SCRIPT" ] guard the same way. Both
are made absolute before the cd, only when the caller is not at the project root, so a run from
the root is unchanged. Fixture: test-mode-contract.sh X.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HXpQSmcGH9hcq6GdHyLxdh
@MendixMau
MendixMau merged commit 958494a into master Nov 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants