File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const postprocessArguments = [
32
32
} ,
33
33
] ,
34
34
] ,
35
- " /mock- filename.js" ,
35
+ ` /mock filename with quotes ", semicolons ; and spaces .js` ,
36
36
] as [ Linter . LintMessage [ ] [ ] , string ] ;
37
37
38
38
export { postprocessArguments } ;
Original file line number Diff line number Diff line change @@ -2,12 +2,15 @@ import * as child_process from "child_process";
2
2
import * as path from "path" ;
3
3
import { Range } from "./Range" ;
4
4
5
+ const sanitizeFilePath = ( filePath : string ) =>
6
+ JSON . stringify ( path . resolve ( filePath ) ) ;
7
+
5
8
const getDiffForFile = ( filePath : string , staged = false ) : string =>
6
9
child_process
7
10
. execSync (
8
11
`git diff --diff-filter=ACM --unified=0 HEAD ${
9
12
staged ? " --staged" : ""
10
- } -- ${ path . resolve ( filePath ) } `
13
+ } -- ${ sanitizeFilePath ( filePath ) } `
11
14
)
12
15
. toString ( ) ;
13
16
You can’t perform that action at this time.
0 commit comments