Install dependencies after creating worktree
Run pnpm install in the new worktree directory before initializing the Paperclip instance so that node_modules are ready when the init step runs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -753,6 +753,19 @@ export async function worktreeMakeCommand(nameArg: string, opts: WorktreeMakeOpt
|
|||||||
throw new Error(extractExecSyncErrorMessage(error) ?? String(error));
|
throw new Error(extractExecSyncErrorMessage(error) ?? String(error));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const installSpinner = p.spinner();
|
||||||
|
installSpinner.start("Installing dependencies...");
|
||||||
|
try {
|
||||||
|
execFileSync("pnpm", ["install"], {
|
||||||
|
cwd: targetPath,
|
||||||
|
stdio: ["ignore", "pipe", "pipe"],
|
||||||
|
});
|
||||||
|
installSpinner.stop("Installed dependencies.");
|
||||||
|
} catch (error) {
|
||||||
|
installSpinner.stop(pc.yellow("Failed to install dependencies (continuing anyway)."));
|
||||||
|
p.log.warning(extractExecSyncErrorMessage(error) ?? String(error));
|
||||||
|
}
|
||||||
|
|
||||||
const originalCwd = process.cwd();
|
const originalCwd = process.cwd();
|
||||||
try {
|
try {
|
||||||
process.chdir(targetPath);
|
process.chdir(targetPath);
|
||||||
|
|||||||
Reference in New Issue
Block a user