feat: use absolute paths by default when using working-directory option (#1231)

This commit is contained in:
Ludovic Fernandez authored and GitHub committed 2025-05-04 22:03:30 +02:00
1 parent 9fae48acfc
commit 7774f98a88
10 files changed
+675 -435

No files matched your search

+4 -2
View File
@@ -123,9 +123,11 @@ async function runLint(binPath: string, patchPath: string): Promise<void> {
if (!fs.existsSync(workingDirectory) || !fs.lstatSync(workingDirectory).isDirectory()) {
throw new Error(`working-directory (${workingDirectory}) was not a path`)
}
if (!userArgNames.has(`path-prefix`)) {
addedArgs.push(`--path-prefix=${workingDirectory}`)
if (!userArgNames.has(`path-prefix`) && !userArgNames.has(`path-mode`)) {
addedArgs.push(`--path-mode=abs`)
}
cmdArgs.cwd = path.resolve(workingDirectory)
}