cluttry 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vwt.json +12 -0
- package/LICENSE +21 -0
- package/README.md +444 -0
- package/dist/commands/doctor.d.ts +7 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +198 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +11 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +90 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.d.ts +11 -0
- package/dist/commands/list.d.ts.map +1 -0
- package/dist/commands/list.js +106 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/open.d.ts +11 -0
- package/dist/commands/open.d.ts.map +1 -0
- package/dist/commands/open.js +52 -0
- package/dist/commands/open.js.map +1 -0
- package/dist/commands/prune.d.ts +7 -0
- package/dist/commands/prune.d.ts.map +1 -0
- package/dist/commands/prune.js +33 -0
- package/dist/commands/prune.js.map +1 -0
- package/dist/commands/rm.d.ts +13 -0
- package/dist/commands/rm.d.ts.map +1 -0
- package/dist/commands/rm.js +99 -0
- package/dist/commands/rm.js.map +1 -0
- package/dist/commands/spawn.d.ts +17 -0
- package/dist/commands/spawn.d.ts.map +1 -0
- package/dist/commands/spawn.js +127 -0
- package/dist/commands/spawn.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +101 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +44 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +109 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/git.d.ts +73 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +225 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/output.d.ts +33 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +83 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/paths.d.ts +36 -0
- package/dist/lib/paths.d.ts.map +1 -0
- package/dist/lib/paths.js +84 -0
- package/dist/lib/paths.js.map +1 -0
- package/dist/lib/secrets.d.ts +50 -0
- package/dist/lib/secrets.d.ts.map +1 -0
- package/dist/lib/secrets.js +146 -0
- package/dist/lib/secrets.js.map +1 -0
- package/dist/lib/types.d.ts +63 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +5 -0
- package/dist/lib/types.js.map +1 -0
- package/package.json +41 -0
- package/src/commands/doctor.ts +222 -0
- package/src/commands/init.ts +120 -0
- package/src/commands/list.ts +133 -0
- package/src/commands/open.ts +70 -0
- package/src/commands/prune.ts +36 -0
- package/src/commands/rm.ts +125 -0
- package/src/commands/spawn.ts +169 -0
- package/src/index.ts +112 -0
- package/src/lib/config.ts +120 -0
- package/src/lib/git.ts +243 -0
- package/src/lib/output.ts +102 -0
- package/src/lib/paths.ts +108 -0
- package/src/lib/secrets.ts +193 -0
- package/src/lib/types.ts +69 -0
- package/tests/config.test.ts +102 -0
- package/tests/paths.test.ts +155 -0
- package/tests/secrets.test.ts +150 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +15 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA+BD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAiE9D"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry init command
|
|
3
|
+
*
|
|
4
|
+
* Create or update repo-level config files for cry.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync, readFileSync, appendFileSync } from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { isGitRepo, getRepoRoot } from '../lib/git.js';
|
|
9
|
+
import { CONFIG_FILE, LOCAL_CONFIG_FILE, configExists, getDefaultConfig, getDefaultLocalConfig, saveConfig, saveLocalConfig, loadConfig, } from '../lib/config.js';
|
|
10
|
+
import * as out from '../lib/output.js';
|
|
11
|
+
/**
|
|
12
|
+
* Ensure entries exist in .gitignore
|
|
13
|
+
*/
|
|
14
|
+
function ensureGitignoreEntries(repoRoot, entries) {
|
|
15
|
+
const gitignorePath = path.join(repoRoot, '.gitignore');
|
|
16
|
+
let content = '';
|
|
17
|
+
if (existsSync(gitignorePath)) {
|
|
18
|
+
content = readFileSync(gitignorePath, 'utf-8');
|
|
19
|
+
}
|
|
20
|
+
const lines = content.split('\n').map((l) => l.trim());
|
|
21
|
+
const added = [];
|
|
22
|
+
for (const entry of entries) {
|
|
23
|
+
if (!lines.includes(entry)) {
|
|
24
|
+
added.push(entry);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
if (added.length > 0) {
|
|
28
|
+
const suffix = content.endsWith('\n') || content === '' ? '' : '\n';
|
|
29
|
+
const header = content === '' ? '' : '\n# cry\n';
|
|
30
|
+
appendFileSync(gitignorePath, suffix + header + added.join('\n') + '\n');
|
|
31
|
+
}
|
|
32
|
+
return added;
|
|
33
|
+
}
|
|
34
|
+
export async function init(options) {
|
|
35
|
+
// Check if we're in a git repo
|
|
36
|
+
if (!isGitRepo()) {
|
|
37
|
+
out.error('Not a git repository. Run this command from within a git repo.');
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
const repoRoot = getRepoRoot();
|
|
41
|
+
const changes = [];
|
|
42
|
+
// Check if config already exists
|
|
43
|
+
if (configExists(repoRoot) && !options.force) {
|
|
44
|
+
out.info(`${CONFIG_FILE} already exists. Use --force to overwrite.`);
|
|
45
|
+
const existing = loadConfig(repoRoot);
|
|
46
|
+
if (existing) {
|
|
47
|
+
out.log('\nCurrent configuration:');
|
|
48
|
+
out.log(JSON.stringify(existing, null, 2));
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
// Create main config
|
|
53
|
+
const config = getDefaultConfig();
|
|
54
|
+
saveConfig(repoRoot, config);
|
|
55
|
+
changes.push(`Created ${out.fmt.path(CONFIG_FILE)}`);
|
|
56
|
+
// Create local config if it doesn't exist
|
|
57
|
+
const localConfigPath = path.join(repoRoot, LOCAL_CONFIG_FILE);
|
|
58
|
+
if (!existsSync(localConfigPath)) {
|
|
59
|
+
const localConfig = getDefaultLocalConfig();
|
|
60
|
+
saveLocalConfig(repoRoot, localConfig);
|
|
61
|
+
changes.push(`Created ${out.fmt.path(LOCAL_CONFIG_FILE)} (gitignored)`);
|
|
62
|
+
}
|
|
63
|
+
// Ensure .gitignore entries
|
|
64
|
+
const gitignoreEntries = [
|
|
65
|
+
LOCAL_CONFIG_FILE,
|
|
66
|
+
'.worktrees/',
|
|
67
|
+
'.worktreeinclude',
|
|
68
|
+
];
|
|
69
|
+
const addedEntries = ensureGitignoreEntries(repoRoot, gitignoreEntries);
|
|
70
|
+
if (addedEntries.length > 0) {
|
|
71
|
+
changes.push(`Added to .gitignore: ${addedEntries.join(', ')}`);
|
|
72
|
+
}
|
|
73
|
+
// Output summary
|
|
74
|
+
out.header('cry Initialized');
|
|
75
|
+
out.newline();
|
|
76
|
+
for (const change of changes) {
|
|
77
|
+
out.success(change);
|
|
78
|
+
}
|
|
79
|
+
out.newline();
|
|
80
|
+
out.log('Configuration created with defaults:');
|
|
81
|
+
out.log(` • Default mode: ${out.fmt.cyan(config.defaultMode)}`);
|
|
82
|
+
out.log(` • Include patterns: ${config.include.map((p) => out.fmt.gray(p)).join(', ')}`);
|
|
83
|
+
out.log(` • Agent command: ${out.fmt.cyan(config.agentCommand ?? 'claude')}`);
|
|
84
|
+
out.newline();
|
|
85
|
+
out.log('Next steps:');
|
|
86
|
+
out.log(` 1. Edit ${out.fmt.path(CONFIG_FILE)} to customize patterns`);
|
|
87
|
+
out.log(` 2. Run ${out.fmt.cyan('cry spawn <branch>')} to create a worktree`);
|
|
88
|
+
out.log(` 3. Run ${out.fmt.cyan('cry doctor')} to verify your setup`);
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAiB,cAAc,EAAE,MAAM,SAAS,CAAC;AAClF,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,UAAU,EACV,eAAe,EACf,UAAU,GACX,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAMxC;;GAEG;AACH,SAAS,sBAAsB,CAAC,QAAgB,EAAE,OAAiB;IACjE,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IACxD,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,IAAI,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,YAAY,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACvD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,KAAK,CAAC,IAAI,CAAC,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CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACjE,GAAG,CAAC,GAAG,CAAC,yBAAyB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1F,GAAG,CAAC,GAAG,CAAC,sBAAsB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE/E,GAAG,CAAC,OAAO,EAAE,CAAC;IACd,GAAG,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACvB,GAAG,CAAC,GAAG,CAAC,aAAa,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IACxE,GAAG,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC;IAC/E,GAAG,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH,UAAU,WAAW;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AA2BD,wBAAsB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAsF9D"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry list command
|
|
3
|
+
*
|
|
4
|
+
* List all worktrees with their status.
|
|
5
|
+
*/
|
|
6
|
+
import { statSync } from 'node:fs';
|
|
7
|
+
import { isGitRepo, getRepoRoot, listWorktrees, isWorktreeDirty, getShortHead, } from '../lib/git.js';
|
|
8
|
+
import * as out from '../lib/output.js';
|
|
9
|
+
function getLastModified(worktreePath) {
|
|
10
|
+
try {
|
|
11
|
+
const stats = statSync(worktreePath);
|
|
12
|
+
return stats.mtime;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function formatRelativeTime(date) {
|
|
19
|
+
if (!date)
|
|
20
|
+
return 'unknown';
|
|
21
|
+
const now = new Date();
|
|
22
|
+
const diffMs = now.getTime() - date.getTime();
|
|
23
|
+
const diffMins = Math.floor(diffMs / 60000);
|
|
24
|
+
const diffHours = Math.floor(diffMs / 3600000);
|
|
25
|
+
const diffDays = Math.floor(diffMs / 86400000);
|
|
26
|
+
if (diffMins < 1)
|
|
27
|
+
return 'just now';
|
|
28
|
+
if (diffMins < 60)
|
|
29
|
+
return `${diffMins}m ago`;
|
|
30
|
+
if (diffHours < 24)
|
|
31
|
+
return `${diffHours}h ago`;
|
|
32
|
+
if (diffDays < 7)
|
|
33
|
+
return `${diffDays}d ago`;
|
|
34
|
+
return date.toLocaleDateString();
|
|
35
|
+
}
|
|
36
|
+
export async function list(options) {
|
|
37
|
+
// Check if we're in a git repo
|
|
38
|
+
if (!isGitRepo()) {
|
|
39
|
+
out.error('Not a git repository. Run this command from within a git repo.');
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
const repoRoot = getRepoRoot();
|
|
43
|
+
const worktrees = listWorktrees(repoRoot);
|
|
44
|
+
// Build list items with extra info
|
|
45
|
+
const items = worktrees.map((wt) => ({
|
|
46
|
+
branch: wt.branch ?? (wt.detached ? '(detached)' : null),
|
|
47
|
+
path: wt.worktree,
|
|
48
|
+
headShort: getShortHead(wt.worktree),
|
|
49
|
+
dirty: isWorktreeDirty(wt.worktree),
|
|
50
|
+
lastModified: getLastModified(wt.worktree),
|
|
51
|
+
}));
|
|
52
|
+
// JSON output
|
|
53
|
+
if (options.json) {
|
|
54
|
+
const jsonItems = items.map((item) => ({
|
|
55
|
+
...item,
|
|
56
|
+
lastModified: item.lastModified?.toISOString() ?? null,
|
|
57
|
+
}));
|
|
58
|
+
out.json(jsonItems);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// No worktrees
|
|
62
|
+
if (items.length === 0) {
|
|
63
|
+
out.info('No worktrees found.');
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// Table output
|
|
67
|
+
out.header('Worktrees');
|
|
68
|
+
out.newline();
|
|
69
|
+
// Calculate column widths
|
|
70
|
+
const branchWidth = Math.max(6, ...items.map((i) => (i.branch ?? '').length));
|
|
71
|
+
const pathWidth = Math.max(4, ...items.map((i) => i.path.length));
|
|
72
|
+
// Header row
|
|
73
|
+
out.log(' ' +
|
|
74
|
+
out.fmt.bold('Branch'.padEnd(branchWidth)) +
|
|
75
|
+
' ' +
|
|
76
|
+
out.fmt.bold('SHA'.padEnd(7)) +
|
|
77
|
+
' ' +
|
|
78
|
+
out.fmt.bold('Status'.padEnd(8)) +
|
|
79
|
+
' ' +
|
|
80
|
+
out.fmt.bold('Modified'.padEnd(12)) +
|
|
81
|
+
' ' +
|
|
82
|
+
out.fmt.bold('Path'));
|
|
83
|
+
out.log(' ' + '─'.repeat(branchWidth + 7 + 8 + 12 + pathWidth + 12));
|
|
84
|
+
// Data rows
|
|
85
|
+
for (const item of items) {
|
|
86
|
+
const branch = (item.branch ?? '(none)').padEnd(branchWidth);
|
|
87
|
+
const sha = item.headShort.padEnd(7);
|
|
88
|
+
const status = item.dirty
|
|
89
|
+
? out.fmt.yellow('dirty'.padEnd(8))
|
|
90
|
+
: out.fmt.green('clean'.padEnd(8));
|
|
91
|
+
const modified = formatRelativeTime(item.lastModified).padEnd(12);
|
|
92
|
+
out.log(' ' +
|
|
93
|
+
out.fmt.branch(branch) +
|
|
94
|
+
' ' +
|
|
95
|
+
out.fmt.dim(sha) +
|
|
96
|
+
' ' +
|
|
97
|
+
status +
|
|
98
|
+
' ' +
|
|
99
|
+
out.fmt.dim(modified) +
|
|
100
|
+
' ' +
|
|
101
|
+
out.fmt.path(item.path));
|
|
102
|
+
}
|
|
103
|
+
out.newline();
|
|
104
|
+
out.log(` ${out.fmt.dim(`${items.length} worktree(s)`)}`);
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/commands/list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,EACb,eAAe,EACf,YAAY,GACb,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAOxC,SAAS,eAAe,CAAC,YAAoB;IAC3C,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QACrC,OAAO,KAAK,CAAC,KAAK,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAiB;IAC3C,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAE5B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;IAC5C,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;IAC/C,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,G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AAC,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry open command
|
|
3
|
+
*
|
|
4
|
+
* Open or navigate to a worktree by branch name or path.
|
|
5
|
+
*/
|
|
6
|
+
interface OpenOptions {
|
|
7
|
+
cmd?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function open(branchOrPath: string, options: OpenOptions): Promise<void>;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=open.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../src/commands/open.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,UAAU,WAAW;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDpF"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry open command
|
|
3
|
+
*
|
|
4
|
+
* Open or navigate to a worktree by branch name or path.
|
|
5
|
+
*/
|
|
6
|
+
import { isGitRepo, getRepoRoot, listWorktrees, runCommand, } from '../lib/git.js';
|
|
7
|
+
import { resolveBranchOrPath } from '../lib/paths.js';
|
|
8
|
+
import * as out from '../lib/output.js';
|
|
9
|
+
export async function open(branchOrPath, options) {
|
|
10
|
+
// Check if we're in a git repo
|
|
11
|
+
if (!isGitRepo()) {
|
|
12
|
+
out.error('Not a git repository. Run this command from within a git repo.');
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
const repoRoot = getRepoRoot();
|
|
16
|
+
const worktrees = listWorktrees(repoRoot);
|
|
17
|
+
// Build lookup list
|
|
18
|
+
const wtList = worktrees.map((wt) => ({
|
|
19
|
+
branch: wt.branch ?? null,
|
|
20
|
+
path: wt.worktree,
|
|
21
|
+
}));
|
|
22
|
+
// Resolve the worktree
|
|
23
|
+
const resolved = resolveBranchOrPath(branchOrPath, wtList, repoRoot);
|
|
24
|
+
if (!resolved) {
|
|
25
|
+
out.error(`Worktree not found: ${branchOrPath}`);
|
|
26
|
+
out.info('Available worktrees:');
|
|
27
|
+
for (const wt of wtList) {
|
|
28
|
+
out.log(` • ${wt.branch ?? '(detached)'} → ${wt.path}`);
|
|
29
|
+
}
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
const { path: wtPath, branch } = resolved;
|
|
33
|
+
// If --cmd is provided, run it
|
|
34
|
+
if (options.cmd) {
|
|
35
|
+
out.log(`Running in ${out.fmt.path(wtPath)}:`);
|
|
36
|
+
out.log(` ${out.fmt.dim('$')} ${options.cmd}`);
|
|
37
|
+
const code = await runCommand(options.cmd, wtPath);
|
|
38
|
+
process.exit(code);
|
|
39
|
+
}
|
|
40
|
+
// Otherwise, print the path and helper
|
|
41
|
+
out.success(`Found worktree: ${branch ? out.fmt.branch(branch) : '(detached)'}`);
|
|
42
|
+
out.newline();
|
|
43
|
+
out.log(`Path: ${out.fmt.path(wtPath)}`);
|
|
44
|
+
out.newline();
|
|
45
|
+
out.log('To navigate there:');
|
|
46
|
+
out.log(` ${out.fmt.cyan(`cd "${wtPath}"`)}`);
|
|
47
|
+
// For shell integration hint
|
|
48
|
+
out.newline();
|
|
49
|
+
out.log(out.fmt.dim('Tip: Use command substitution in your shell:'));
|
|
50
|
+
out.log(out.fmt.dim(` cd "$(vwt open ${branchOrPath} 2>/dev/null | grep "^Path:" | cut -d' ' -f2-)"`));
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=open.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.js","sourceRoot":"","sources":["../../src/commands/open.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,W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
|
|
1
|
+
{"version":3,"file":"prune.d.ts","sourceRoot":"","sources":["../../src/commands/prune.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,wBAAsB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CA0B3C"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry prune command
|
|
3
|
+
*
|
|
4
|
+
* Clean up stale worktree references.
|
|
5
|
+
*/
|
|
6
|
+
import { isGitRepo, getRepoRoot, pruneWorktrees } from '../lib/git.js';
|
|
7
|
+
import * as out from '../lib/output.js';
|
|
8
|
+
export async function prune() {
|
|
9
|
+
// Check if we're in a git repo
|
|
10
|
+
if (!isGitRepo()) {
|
|
11
|
+
out.error('Not a git repository. Run this command from within a git repo.');
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const repoRoot = getRepoRoot();
|
|
15
|
+
out.log('Pruning stale worktree references...');
|
|
16
|
+
out.newline();
|
|
17
|
+
try {
|
|
18
|
+
const output = pruneWorktrees(repoRoot);
|
|
19
|
+
if (output.trim()) {
|
|
20
|
+
out.log(output);
|
|
21
|
+
out.newline();
|
|
22
|
+
out.success('Pruned stale worktree references');
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
out.success('No stale worktree references found');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
out.error(`Failed to prune: ${error.message}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=prune.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prune.js","sourceRoot":"","sources":["../../src/commands/prune.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAExC,MAAM,CAAC,KAAK,UAAU,KAAK;IACzB,+BAA+B;IAC/B,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC;QACjB,GAAG,CAAC,KAAK,CAAC,gEAAgE,CAAC,CAAC;QAC5E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,GAAG,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;IAChD,GAAG,CAAC,OAAO,EAAE,CAAC;IAEd,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC;QAExC,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;YAClB,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YAChB,GAAG,CAAC,OAAO,EAAE,CAAC;YACd,GAAG,CAAC,OAAO,CAAC,kCAAkC,CAAC,CAAC;QAClD,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,OAAO,CAAC,oCAAoC,CAAC,CAAC;QACpD,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,KAAK,CAAC,oBAAqB,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry rm command
|
|
3
|
+
*
|
|
4
|
+
* Remove a worktree safely with optional branch deletion.
|
|
5
|
+
*/
|
|
6
|
+
interface RmOptions {
|
|
7
|
+
withBranch?: boolean;
|
|
8
|
+
force?: boolean;
|
|
9
|
+
yes?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function rm(branchOrPath: string, options: RmOptions): Promise<void>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=rm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rm.d.ts","sourceRoot":"","sources":["../../src/commands/rm.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,UAAU,SAAS;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAgBD,wBAAsB,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAqFhF"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry rm command
|
|
3
|
+
*
|
|
4
|
+
* Remove a worktree safely with optional branch deletion.
|
|
5
|
+
*/
|
|
6
|
+
import { createInterface } from 'node:readline';
|
|
7
|
+
import { isGitRepo, getRepoRoot, listWorktrees, removeWorktree, deleteBranch, isWorktreeDirty, getCurrentBranch, } from '../lib/git.js';
|
|
8
|
+
import { resolveBranchOrPath } from '../lib/paths.js';
|
|
9
|
+
import * as out from '../lib/output.js';
|
|
10
|
+
async function confirm(message) {
|
|
11
|
+
const rl = createInterface({
|
|
12
|
+
input: process.stdin,
|
|
13
|
+
output: process.stdout,
|
|
14
|
+
});
|
|
15
|
+
return new Promise((resolve) => {
|
|
16
|
+
rl.question(`${message} [y/N] `, (answer) => {
|
|
17
|
+
rl.close();
|
|
18
|
+
resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
export async function rm(branchOrPath, options) {
|
|
23
|
+
// Check if we're in a git repo
|
|
24
|
+
if (!isGitRepo()) {
|
|
25
|
+
out.error('Not a git repository. Run this command from within a git repo.');
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
const repoRoot = getRepoRoot();
|
|
29
|
+
const worktrees = listWorktrees(repoRoot);
|
|
30
|
+
// Build lookup list
|
|
31
|
+
const wtList = worktrees.map((wt) => ({
|
|
32
|
+
branch: wt.branch ?? null,
|
|
33
|
+
path: wt.worktree,
|
|
34
|
+
}));
|
|
35
|
+
// Resolve the worktree
|
|
36
|
+
const resolved = resolveBranchOrPath(branchOrPath, wtList, repoRoot);
|
|
37
|
+
if (!resolved) {
|
|
38
|
+
out.error(`Worktree not found: ${branchOrPath}`);
|
|
39
|
+
out.info('Available worktrees:');
|
|
40
|
+
for (const wt of wtList) {
|
|
41
|
+
out.log(` • ${wt.branch ?? '(detached)'} → ${wt.path}`);
|
|
42
|
+
}
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
const { path: wtPath, branch } = resolved;
|
|
46
|
+
// Check if it's the main worktree (the original checkout)
|
|
47
|
+
if (wtPath === repoRoot) {
|
|
48
|
+
out.error('Cannot remove the main worktree.');
|
|
49
|
+
out.info('This is your primary repository checkout.');
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
// Check if dirty
|
|
53
|
+
const dirty = isWorktreeDirty(wtPath);
|
|
54
|
+
if (dirty && !options.force) {
|
|
55
|
+
out.error('Worktree has uncommitted changes.');
|
|
56
|
+
out.info('Use --force to remove anyway (changes will be lost).');
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
// Warn and confirm if dirty and force
|
|
60
|
+
if (dirty && options.force && !options.yes) {
|
|
61
|
+
out.warn('Worktree has uncommitted changes that will be lost!');
|
|
62
|
+
const confirmed = await confirm('Are you sure you want to remove it?');
|
|
63
|
+
if (!confirmed) {
|
|
64
|
+
out.log('Aborted.');
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Remove the worktree
|
|
69
|
+
out.log(`Removing worktree: ${out.fmt.path(wtPath)}`);
|
|
70
|
+
try {
|
|
71
|
+
removeWorktree(wtPath, options.force ?? false, repoRoot);
|
|
72
|
+
out.success('Worktree removed');
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
out.error(`Failed to remove worktree: ${error.message}`);
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
// Optionally delete the branch
|
|
79
|
+
if (options.withBranch && branch) {
|
|
80
|
+
const currentBranch = getCurrentBranch(repoRoot);
|
|
81
|
+
if (branch === currentBranch) {
|
|
82
|
+
out.warn(`Cannot delete branch '${branch}' - it's currently checked out in main worktree.`);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
out.log(`Deleting branch: ${out.fmt.branch(branch)}`);
|
|
86
|
+
try {
|
|
87
|
+
deleteBranch(branch, options.force ?? false, repoRoot);
|
|
88
|
+
out.success('Branch deleted');
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
out.warn(`Failed to delete branch: ${error.message}`);
|
|
92
|
+
out.info('You may need to use --force or delete it manually.');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
out.newline();
|
|
97
|
+
out.success('Done');
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=rm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rm.js","sourceRoot":"","sources":["../../src/commands/rm.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,SAAS,EACT,WAAW,EACX,aAAa,EACb,cAAc,EACd,YAAY,EACZ,eAAe,EACf,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,GAAG,MAAM,kBAAkB,CAAC;AAQxC,KAAK,UAAU,OAAO,CAAC,OAAe;IACpC,MAAM,EAAE,GAAG,eAAe,CAAC;QACzB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,EAAE,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,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAClC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,KAAK,CAAC,8BAA+B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;QACpE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,+BAA+B;IAC/B,IAAI,OAAO,CAAC,UAAU,IAAI,MAAM,EAAE,CAAC;QACjC,MAAM,aAAa,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;QAEjD,IAAI,MAAM,KAAK,aAAa,EAAE,CAAC;YAC7B,GAAG,CAAC,IAAI,CAAC,yBAAyB,MAAM,kDAAkD,CAAC,CAAC;QAC9F,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,oBAAoB,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YACtD,IAAI,CAAC;gBACH,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK,EAAE,QAAQ,CAAC,CAAC;gBACvD,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;YAChC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,IAAI,CAAC,4BAA6B,KAAe,CAAC,OAAO,EAAE,CAAC,CAAC;gBACjE,GAAG,CAAC,IAAI,CAAC,oDAAoD,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;IAED,GAAG,CAAC,OAAO,EAAE,CAAC;IACd,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry spawn command
|
|
3
|
+
*
|
|
4
|
+
* Create a worktree for a branch with optional secrets handling and hooks.
|
|
5
|
+
*/
|
|
6
|
+
import type { SecretMode } from '../lib/types.js';
|
|
7
|
+
interface SpawnOptions {
|
|
8
|
+
new?: boolean;
|
|
9
|
+
path?: string;
|
|
10
|
+
base?: string;
|
|
11
|
+
mode?: SecretMode;
|
|
12
|
+
run?: string;
|
|
13
|
+
agent?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function spawn(branch: string, options: SpawnOptions): Promise<void>;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=spawn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/commands/spawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAkBH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,UAAU,YAAY;IACpB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuIhF"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cry spawn command
|
|
3
|
+
*
|
|
4
|
+
* Create a worktree for a branch with optional secrets handling and hooks.
|
|
5
|
+
*/
|
|
6
|
+
import { existsSync } from 'node:fs';
|
|
7
|
+
import { isGitRepo, getRepoRoot, getRepoName, branchExists, addWorktree, listWorktrees, runCommand, commandExists, } from '../lib/git.js';
|
|
8
|
+
import { getMergedConfig, configExists } from '../lib/config.js';
|
|
9
|
+
import { getDefaultWorktreePath } from '../lib/paths.js';
|
|
10
|
+
import { processSecrets } from '../lib/secrets.js';
|
|
11
|
+
import * as out from '../lib/output.js';
|
|
12
|
+
export async function spawn(branch, options) {
|
|
13
|
+
// Check if we're in a git repo
|
|
14
|
+
if (!isGitRepo()) {
|
|
15
|
+
out.error('Not a git repository. Run this command from within a git repo.');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const repoRoot = getRepoRoot();
|
|
19
|
+
const repoName = getRepoName();
|
|
20
|
+
// Load config
|
|
21
|
+
const config = configExists(repoRoot) ? getMergedConfig(repoRoot) : {
|
|
22
|
+
worktreeBaseDir: undefined,
|
|
23
|
+
defaultMode: 'none',
|
|
24
|
+
include: [],
|
|
25
|
+
hooks: { postCreate: [] },
|
|
26
|
+
agentCommand: 'claude',
|
|
27
|
+
};
|
|
28
|
+
// Determine mode
|
|
29
|
+
const mode = options.mode ?? config.defaultMode;
|
|
30
|
+
// Calculate worktree path
|
|
31
|
+
const worktreePath = getDefaultWorktreePath(repoRoot, branch, {
|
|
32
|
+
explicitPath: options.path,
|
|
33
|
+
baseDir: options.base ?? config.worktreeBaseDir,
|
|
34
|
+
repoName,
|
|
35
|
+
});
|
|
36
|
+
// Check if destination already exists
|
|
37
|
+
if (existsSync(worktreePath)) {
|
|
38
|
+
out.error(`Destination already exists: ${worktreePath}`);
|
|
39
|
+
out.info('Remove it first or choose a different path with --path');
|
|
40
|
+
process.exit(1);
|
|
41
|
+
}
|
|
42
|
+
// Check if worktree already exists for this branch
|
|
43
|
+
const existingWorktrees = listWorktrees(repoRoot);
|
|
44
|
+
const existingForBranch = existingWorktrees.find((w) => w.branch === branch);
|
|
45
|
+
if (existingForBranch) {
|
|
46
|
+
out.error(`A worktree already exists for branch '${branch}'`);
|
|
47
|
+
out.info(`Path: ${existingForBranch.worktree}`);
|
|
48
|
+
out.info('Remove it first with: cry rm ' + branch);
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
// Determine if we need to create the branch
|
|
52
|
+
const needsNewBranch = options.new || !branchExists(branch, repoRoot);
|
|
53
|
+
out.header('Creating worktree');
|
|
54
|
+
out.log(` Branch: ${out.fmt.branch(branch)}${needsNewBranch ? out.fmt.gray(' (new)') : ''}`);
|
|
55
|
+
out.log(` Path: ${out.fmt.path(worktreePath)}`);
|
|
56
|
+
out.log(` Mode: ${out.fmt.cyan(mode)}`);
|
|
57
|
+
out.newline();
|
|
58
|
+
// Create the worktree
|
|
59
|
+
try {
|
|
60
|
+
addWorktree(worktreePath, branch, needsNewBranch, repoRoot);
|
|
61
|
+
out.success('Worktree created');
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
out.error(`Failed to create worktree: ${error.message}`);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
// Handle secrets
|
|
68
|
+
if (mode !== 'none' && config.include.length > 0) {
|
|
69
|
+
out.newline();
|
|
70
|
+
out.log(`Processing secrets (${mode} mode)...`);
|
|
71
|
+
const { processed, skipped } = await processSecrets(mode, config.include, repoRoot, worktreePath);
|
|
72
|
+
if (processed.length > 0) {
|
|
73
|
+
out.success(`${mode === 'copy' ? 'Copied' : 'Symlinked'} ${processed.length} file(s):`);
|
|
74
|
+
for (const file of processed) {
|
|
75
|
+
out.log(` ${out.fmt.dim('•')} ${file}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (skipped.length > 0) {
|
|
79
|
+
out.warn(`Skipped ${skipped.length} file(s) for safety:`);
|
|
80
|
+
for (const file of skipped) {
|
|
81
|
+
out.log(` ${out.fmt.dim('•')} ${file.path}: ${file.reason}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
// Run post-create hooks from config
|
|
86
|
+
const hooks = config.hooks.postCreate;
|
|
87
|
+
if (hooks.length > 0) {
|
|
88
|
+
out.newline();
|
|
89
|
+
out.log('Running post-create hooks...');
|
|
90
|
+
for (const hook of hooks) {
|
|
91
|
+
out.log(` ${out.fmt.dim('$')} ${hook}`);
|
|
92
|
+
const code = await runCommand(hook, worktreePath);
|
|
93
|
+
if (code !== 0) {
|
|
94
|
+
out.warn(`Hook exited with code ${code}`);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Run --run command if provided
|
|
99
|
+
if (options.run) {
|
|
100
|
+
out.newline();
|
|
101
|
+
out.log('Running custom command...');
|
|
102
|
+
out.log(` ${out.fmt.dim('$')} ${options.run}`);
|
|
103
|
+
const code = await runCommand(options.run, worktreePath);
|
|
104
|
+
if (code !== 0) {
|
|
105
|
+
out.warn(`Command exited with code ${code}`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// Handle agent launch
|
|
109
|
+
const agentChoice = options.agent ?? 'none';
|
|
110
|
+
if (agentChoice === 'claude') {
|
|
111
|
+
const agentCmd = config.agentCommand;
|
|
112
|
+
out.newline();
|
|
113
|
+
if (commandExists(agentCmd)) {
|
|
114
|
+
out.log(`Launching ${agentCmd}...`);
|
|
115
|
+
await runCommand(agentCmd, worktreePath);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
out.warn(`Agent command '${agentCmd}' not found.`);
|
|
119
|
+
out.info('Install Claude Code: https://docs.anthropic.com/claude-code');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Final summary
|
|
123
|
+
out.newline();
|
|
124
|
+
out.header('Worktree ready');
|
|
125
|
+
out.log(` ${out.fmt.dim('cd')} ${worktreePath}`);
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=spawn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spawn.js","sourceRoot":"","sources":["../../src/commands/spawn.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,SAAS,EACT,WAAW,EACX,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM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