Skip to content

Commit d3b371b

Browse files
committed
Add worktree create in parent
1 parent 116ce81 commit d3b371b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.claude/settings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,26 @@
1111
}
1212
]
1313
}
14+
],
15+
"WorktreeCreate": [
16+
{
17+
"hooks": [
18+
{
19+
"type": "command",
20+
"command": "bash -c 'INPUT=$(cat); NAME=$(echo \"$INPUT\" | jq -r .name); REPO=$(echo \"$INPUT\" | jq -r .cwd); PARENT=$(dirname \"$REPO\"); DIR=\"$PARENT/$(basename \"$REPO\")-$NAME\"; git -C \"$REPO\" worktree add \"$DIR\" -b \"worktree-$NAME\" >&2 && echo \"$DIR\"'"
21+
}
22+
]
23+
}
24+
],
25+
"WorktreeRemove": [
26+
{
27+
"hooks": [
28+
{
29+
"type": "command",
30+
"command": "bash -c 'INPUT=$(cat); WPATH=$(echo \"$INPUT\" | jq -r .worktree_path); REPO=$(git -C \"$WPATH\" rev-parse --path-format=absolute --git-common-dir 2>/dev/null | sed \"s|/.git$||\" ); git -C \"$REPO\" worktree remove \"$WPATH\" 2>/dev/null; rm -rf \"$WPATH\"'"
31+
}
32+
]
33+
}
1434
]
1535
}
1636
}

0 commit comments

Comments
 (0)