Skip to content

Commit 65a1769

Browse files
authored
chore(repo): use mise exec when running commands in cloned repos (#35391)
## Current Behavior `update-repos` spawns child processes to run `pnpm install`, `nx migrate`, etc. inside each cloned target repo. The child inherits the launching shell's `PATH`, which mise activation populated with hardcoded version-specific install paths (e.g. `/.../installs/node/24.11.0/bin`). Mise activation is a shell hook on `cd` — it does not re-fire when a child process changes its own `cwd`. As a result, every cloned repo's commands run against the outer shell's pinned tool versions rather than the versions in the cloned repo's own `mise.toml`. ## Expected Behavior Each cloned repo's commands honor the tool versions pinned in that repo's `mise.toml`. `execWithOutput` now prefixes every spawned command with `mise exec --` (except commands that already start with `mise`, so `mise trust` / `mise install` aren't wrapped in themselves). `mise exec` re-reads `mise.toml` from the `cwd` at invocation time and activates the correct tool versions for that repo. ## Related Issue(s) Fixes #
1 parent 3d9bc7a commit 65a1769

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tools/update-repos/src/update-repo.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ async function execWithOutput(
5353
if (description) {
5454
log(`🔄 ${description}`);
5555
}
56-
log(`📝 Running: ${command}`);
56+
const finalCommand = command.startsWith('mise ')
57+
? command
58+
: `mise exec -- ${command}`;
59+
log(`📝 Running: ${finalCommand}`);
5760

5861
return new Promise((resolve, reject) => {
59-
const child = spawn('bash', ['-c', command], {
62+
const child = spawn('bash', ['-c', finalCommand], {
6063
cwd,
6164
stdio: ['inherit', 'pipe', 'pipe'],
6265
});

0 commit comments

Comments
 (0)