lathe-cli 1.3.0 → 1.3.1
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/bin/_lathe-task.sh +12 -0
- package/bin/lathe-plan +5 -3
- package/bin/lathe-process +2 -2
- package/package.json +1 -1
package/bin/_lathe-task.sh
CHANGED
|
@@ -76,6 +76,18 @@ lathe_prepare_pr_task() {
|
|
|
76
76
|
exit 1
|
|
77
77
|
fi
|
|
78
78
|
echo "==> Reusing task worktree at $TASK_WT (branch: $TASK_BRANCH)"
|
|
79
|
+
if ! git -C "$TASK_WT" diff --quiet || ! git -C "$TASK_WT" diff --cached --quiet; then
|
|
80
|
+
echo "lathe: $TASK_WT has uncommitted changes; refusing to update from PR head" >&2
|
|
81
|
+
exit 1
|
|
82
|
+
fi
|
|
83
|
+
if git -C "$TASK_WT" merge-base --is-ancestor HEAD "$FETCH_REF"; then
|
|
84
|
+
git -C "$TASK_WT" merge --ff-only --quiet "$FETCH_REF"
|
|
85
|
+
elif git -C "$TASK_WT" merge-base --is-ancestor "$FETCH_REF" HEAD; then
|
|
86
|
+
:
|
|
87
|
+
else
|
|
88
|
+
echo "lathe: $TASK_BRANCH has diverged from PR #$PR_NUMBER head; resolve manually before continuing" >&2
|
|
89
|
+
exit 1
|
|
90
|
+
fi
|
|
79
91
|
else
|
|
80
92
|
if git --git-dir="$GIT_DIR" rev-parse --verify "$TASK_BRANCH" >/dev/null 2>&1; then
|
|
81
93
|
echo "==> Creating task worktree at $TASK_WT (branch: $TASK_BRANCH)..."
|
package/bin/lathe-plan
CHANGED
|
@@ -84,7 +84,7 @@ case "$MODE" in
|
|
|
84
84
|
|
|
85
85
|
Run target planning when ready:
|
|
86
86
|
cd "$DEVELOP_WT"
|
|
87
|
-
claude --add-dir "$TASK_WT" "$INITIAL_PROMPT"
|
|
87
|
+
claude --add-dir "$TASK_WT" -- "$INITIAL_PROMPT"
|
|
88
88
|
EOF
|
|
89
89
|
;;
|
|
90
90
|
|
|
@@ -105,13 +105,15 @@ EOF
|
|
|
105
105
|
echo ""
|
|
106
106
|
echo "Running target planning non-interactively..."
|
|
107
107
|
cd "$DEVELOP_WT"
|
|
108
|
-
exec claude --print --permission-mode auto
|
|
108
|
+
exec claude --print --permission-mode auto \
|
|
109
|
+
--allowedTools Read Write Edit Glob Grep "Bash(date *)" "Bash(git status*)" "Bash(git diff*)" "Bash(git ls-files*)" \
|
|
110
|
+
--add-dir "$TASK_WT" -- "$INITIAL_PROMPT"
|
|
109
111
|
;;
|
|
110
112
|
|
|
111
113
|
auto)
|
|
112
114
|
echo ""
|
|
113
115
|
echo "Launching target for planning with the initial prompt already submitted..."
|
|
114
116
|
cd "$DEVELOP_WT"
|
|
115
|
-
exec claude --add-dir "$TASK_WT" "$INITIAL_PROMPT"
|
|
117
|
+
exec claude --add-dir "$TASK_WT" -- "$INITIAL_PROMPT"
|
|
116
118
|
;;
|
|
117
119
|
esac
|
package/bin/lathe-process
CHANGED
|
@@ -133,7 +133,7 @@ case "$MODE" in
|
|
|
133
133
|
|
|
134
134
|
Run target when ready:
|
|
135
135
|
cd "$DEVELOP_WT"
|
|
136
|
-
claude --add-dir "$TASK_WT" "$INITIAL_PROMPT"
|
|
136
|
+
claude --add-dir "$TASK_WT" -- "$INITIAL_PROMPT"
|
|
137
137
|
EOF
|
|
138
138
|
exit 0
|
|
139
139
|
;;
|
|
@@ -161,7 +161,7 @@ EOF
|
|
|
161
161
|
echo "Launching target with the initial prompt already submitted..."
|
|
162
162
|
cd "$DEVELOP_WT"
|
|
163
163
|
set +e
|
|
164
|
-
claude --add-dir "$TASK_WT" "$INITIAL_PROMPT"
|
|
164
|
+
claude --add-dir "$TASK_WT" -- "$INITIAL_PROMPT"
|
|
165
165
|
status=$?
|
|
166
166
|
set -e
|
|
167
167
|
print_aftercare
|