with open("cli/src/__tests__/worktree.test.ts", "r") as f: content = f.read() content = content.replace("const resolvedTargetHooksDir = fs.realpathSync(path.resolve(worktreePath, targetHooksDir));", "const resolvedTargetHooksDir = path.resolve(worktreePath, targetHooksDir); if(!fs.existsSync(resolvedTargetHooksDir)) { fs.mkdirSync(resolvedTargetHooksDir, { recursive: true }); }") with open("cli/src/__tests__/worktree.test.ts", "w") as f: f.write(content)