Fix failure in react-native link on Windows (#603)

Fix issue #530.
Every so often you run the command react-native link an exception is thrown because the \n in regex does not lead to the line.
This commit is contained in:
Luca Pau
2016-11-14 21:07:55 +01:00
committed by Richard Hua
parent ae0d35244f
commit 3ccfa67528

View File

@@ -31,7 +31,7 @@ if (~appDelegateContents.indexOf(codePushHeaderImportStatement)) {
}
// 2. Modify jsCodeLocation value assignment
var oldJsCodeLocationAssignmentStatement = appDelegateContents.match(/(jsCodeLocation = .*)\n/)[1];
var oldJsCodeLocationAssignmentStatement = appDelegateContents.match(/(jsCodeLocation = .*)/)[1];
var newJsCodeLocationAssignmentStatement = "jsCodeLocation = [CodePush bundleURL];";
if (~appDelegateContents.indexOf(newJsCodeLocationAssignmentStatement)) {
console.log(`"jsCodeLocation" already pointing to "[CodePush bundleURL]".`);