Commit 8cae659e authored by Norris Oduro's avatar Norris Oduro Committed by Joe Haddad
Browse files

Fix path regex match bug (#3686)

* Fix path regex match bug

* Use the escape-string-regexp package to escape regex characters

* Remove redundant character escape from path

* Add removed escape of backslashes
parent 12120f6f
3 merge requests!12191Lim.Pisey.168:/Identified - We are currently investigating reports of missing build logs. The issue has been identified and a resolution is in progress. We will provide a further update when available.Mar 21, 09:02 UTC,!12853brikk,!5717Automatically extract project file structure from build bundle file
Showing with 4 additions and 3 deletions
+4 -3
...@@ -8,12 +8,13 @@ ...@@ -8,12 +8,13 @@
'use strict'; 'use strict';
const path = require('path'); const path = require('path');
const escape = require('escape-string-regexp');
module.exports = function ignoredFiles(appSrc) { module.exports = function ignoredFiles(appSrc) {
return new RegExp( return new RegExp(
`^(?!${path `^(?!${escape(
.normalize(appSrc + '/') path.normalize(appSrc + '/').replace(/[\\]+/g, '/')
.replace(/[\\]+/g, '/')}).+/node_modules/`, )}).+/node_modules/`,
'g' 'g'
); );
}; };
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment