Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 571c7f2

Browse files
committed
fix: escape the regex for the path to the entry module of application
1 parent cf74631 commit 571c7f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const path = require("path");
22
const { existsSync } = require("fs");
3+
const escapeRegExp = require("escape-string-regexp");
34
const { ANDROID_APP_PATH } = require("./androidProjectHelpers");
45
const {
56
getPackageJson,
@@ -62,8 +63,7 @@ exports.getAppPath = (platform, projectDir) => {
6263

6364
exports.getEntryPathRegExp = (appFullPath, entryModule) => {
6465
const entryModuleFullPath = path.join(appFullPath, entryModule);
65-
// Windows paths contain `\`, so we need to convert each of the `\` to `\\`, so it will be correct inside RegExp
66-
const escapedPath = entryModuleFullPath.replace(/\\/g, "\\\\");
66+
const escapedPath = escapeRegExp(entryModuleFullPath);
6767
return new RegExp(escapedPath);
6868
}
6969

0 commit comments

Comments
 (0)