Skip to content

Commit f535774

Browse files
authored
pr2wt : symlink .pi (#22386)
1 parent 06a811d commit f535774

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/pr2wt.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,19 @@ dir=$(basename $(pwd))
6868
git branch -D pr/$PR 2> /dev/null
6969
git worktree add -b pr/$PR ../$dir-pr-$PR pr/$PR/$head_ref 2> /dev/null
7070

71+
og_path=$(pwd)
7172
wt_path=$(cd ../$dir-pr-$PR && pwd)
7273

7374
echo "git worktree created in $wt_path"
7475

7576
cd $wt_path
77+
78+
# pi agent setup in the worktree
79+
if [[ -f "$og_path/.pi/SYSTEM.md" && ! -f ".pi/SYSTEM.md" ]]; then
80+
mkdir -p .pi
81+
ln -sfn "$og_path/.pi/SYSTEM.md" .pi/SYSTEM.md
82+
fi
83+
7684
git branch --set-upstream-to=pr/$PR/$head_ref
7785
git pull --ff-only || {
7886
echo "error: failed to pull pr/$PR"

0 commit comments

Comments
 (0)