Skip to content

Commit b8469f4

Browse files
committed
fix: support Windows paths in auto-push file detection
The extractFilePathsFromText regex only matched macOS/Linux absolute paths (/Users/..., ~/...), causing auto-push to silently fail on Windows where paths look like C:\Users\... Added [A-Za-z]:[\/] pattern to match Windows drive-letter paths alongside existing Unix and tilde paths.
1 parent 48e0da2 commit b8469f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const AUTO_PUSH_EXTENSIONS = new Set([
3737
/** Extract local file paths from Claude's response text. */
3838
function extractFilePathsFromText(text: string, cwd: string): string[] {
3939
const paths: string[] = [];
40-
// Match absolute paths (macOS/Linux) and tilde paths with a file extension
41-
const regex = /(?:\/(?:Users|home|tmp|var|etc)\/[^\s`'"()\[\]{}|<>]+\.\w+|~\/[^\s`'"()\[\]{}|<>]+\.\w+)/g;
40+
// Match absolute paths (macOS/Linux), tilde paths, and Windows paths with a file extension
41+
const regex = /(?:\/(?:Users|home|tmp|var|etc)\/[^\s`'"()\[\]{}|<>]+\.\w+|~\/[^\s`'"()\[\]{}|<>]+\.\w+|[A-Za-z]:[\\/][^\s`'"()\[\]{}|<>]+\.\w+)/g;
4242
let match: RegExpExecArray | null;
4343
while ((match = regex.exec(text)) !== null) {
4444
const raw = match[0];

0 commit comments

Comments
 (0)