Skip to content

Commit

Permalink
handle file not found
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 committed Jan 31, 2022
1 parent d68fa08 commit 90d5e66
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions test-app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,17 @@ private static void applySettings(Settings settings) {
// TODO: Remove when `@react-native-community/cli` 6.0+ is required. See also
// https://github.com/react-native-community/cli/commit/fa0d09b2c9be144bbdff526bb14f171d7ddca88e
private static void patchArgumentTypeMismatchError(String cliAndroidDir) {
def script = new File("${cliAndroidDir}/native_modules.gradle")
def patched = script.text.replace(
"ArrayList<HashMap<String, String>>[] packages = this.reactNativeModules",
"ArrayList<HashMap<String, String>> packages = this.reactNativeModules",
)
script.write(patched)
try {
def script = new File("${cliAndroidDir}/native_modules.gradle")
def content = script.text
def patched = content.replace(
"ArrayList<HashMap<String, String>>[] packages = this.reactNativeModules",
"ArrayList<HashMap<String, String>> packages = this.reactNativeModules",
)
script.write(patched)
} catch (FileNotFoundException) {
// If the file is not found, we no longer need to patch it
}
}

def scriptDir = buildscript.sourceFile.getParent()
Expand Down

0 comments on commit 90d5e66

Please sign in to comment.