|
2 | 2 | // Licensed under the MIT license. See LICENSE file in the project root for details. |
3 | 3 |
|
4 | 4 | import * as assert from "assert"; |
5 | | -import * as vscode from "vscode"; |
6 | 5 | import * as path from "path"; |
7 | 6 | import * as fs from "fs"; |
| 7 | +import * as vscode from "vscode"; |
8 | 8 | import { ErrorHelper } from "../../common/error/errorHelper"; |
9 | 9 | import { InternalErrorCode } from "../../common/error/internalErrorCode"; |
10 | | -import { Command } from "./util/command"; |
11 | 10 | import { FileSystem } from "../../common/node/fileSystem"; |
12 | 11 | import { OutputChannelLogger } from "../log/OutputChannelLogger"; |
13 | 12 | import { CommandExecutor } from "../../common/commandExecutor"; |
14 | 13 | import { AppLauncher } from "../appLauncher"; |
| 14 | +import { Command } from "./util/command"; |
15 | 15 |
|
16 | 16 | const logger = OutputChannelLogger.getMainChannel(); |
17 | 17 |
|
@@ -58,19 +58,17 @@ export class EnableHermes extends Command { |
58 | 58 | ); |
59 | 59 | await this.nodeFileSystem.writeFile(podfilePath, updatedHermes); |
60 | 60 | await commandExecutor.spawn("pod", ["install"]); |
61 | | - } else { |
62 | | - if (rnMatches) { |
63 | | - let content = rnMatches[1]; |
64 | | - const closing = rnMatches[2]; |
| 61 | + } else if (rnMatches) { |
| 62 | + let content = rnMatches[1]; |
| 63 | + const closing = rnMatches[2]; |
65 | 64 |
|
66 | | - if (!content.trim().endsWith(",")) { |
67 | | - content += ","; |
68 | | - } |
69 | | - content += `\n :hermes_enabled => ${isHermesEnabled}`; |
70 | | - const newData = podfileContent.replace(regex, content + closing); |
71 | | - await this.nodeFileSystem.writeFile(podfilePath, newData); |
72 | | - await commandExecutor.spawn("pod", ["install"]); |
| 65 | + if (!content.trim().endsWith(",")) { |
| 66 | + content += ","; |
73 | 67 | } |
| 68 | + content += `\n :hermes_enabled => ${isHermesEnabled}`; |
| 69 | + const newData = podfileContent.replace(regex, content + closing); |
| 70 | + await this.nodeFileSystem.writeFile(podfilePath, newData); |
| 71 | + await commandExecutor.spawn("pod", ["install"]); |
74 | 72 | } |
75 | 73 | } |
76 | 74 | if (type === "Android") { |
|
0 commit comments