File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ const diffLineNumbers = require("./tools/diff-line-numbers");
88const parseDiff = require ( "./tools/parse-diff" ) ;
99const compareDiff = require ( "./tools/compare-diff" ) ;
1010
11- const WORKING_DIR = process . env . WORKING_DIR ;
11+ const NYC_OUTPUT_LOCATION = process . env . NYC_OUTPUT_LOCATION ;
1212
1313const DIFF_LOCATION = __dirname + "/branch.diff" ;
1414
15- diffLineNumbers ( process . stdin , fs . createWriteStream ( ) , ( ) => {
15+ diffLineNumbers ( process . stdin , fs . createWriteStream ( DIFF_LOCATION ) , ( ) => {
1616 parseDiff ( DIFF_LOCATION )
1717 . then ( compareDiff )
1818 . then ( exitWithSuccess ( ) )
Original file line number Diff line number Diff line change @@ -10,15 +10,14 @@ module.exports = path => {
1010 const lines = chunk . split ( "\n" ) ;
1111 if ( chunk && lines && lines [ 0 ] && lines [ 0 ] !== "" ) {
1212 const filePathFromRoot = lines [ 0 ] . replace ( / ( d i f f - - g i t ) ( a \/ ) | ( b \/ .* ) / gi, "" ) . split ( " " ) [ 0 ] ;
13- const diffLines = chunk . match ( / [ 0 - 9 ] + ( \s ) + : \s \+ / gi) ;
13+ const diffLines = chunk . match ( / [ 0 - 9 ] + ( \s ) { 0 , } \: ( \+ ) / gi) ;
1414 if ( diffLines && diffLines instanceof Array ) {
1515 let lineNumbers ;
1616 try {
1717 lineNumbers = diffLines . map ( l => parseInt ( l . replace ( / ( \s ) + ( : ) / g, "" ) ) ) ;
1818 } catch ( err ) {
1919 exitWithFailure ( "An error occured while parsing diff for line numbers." ) ( err ) ;
2020 }
21- // eslint-disable-next-line security/detect-object-injection
2221 map . push ( [ filePathFromRoot , lineNumbers ] ) ;
2322 }
2423 }
You can’t perform that action at this time.
0 commit comments