Skip to content

Commit

Permalink
Use bundle install before pod install when bundle is used (#624)
Browse files Browse the repository at this point in the history
In #617 we added an option for the IDE to use bundle command instead of
pods directly as it is now recommended in new react native templates and
setups. However, for bundle to work properly, we need to `bundle
install` first. This was missed in that PR as I was testing a project
where bundle install has already run.

This PR changes the pod installation command to: `bundle install &&
bundle exec pod install` as recommended by react native docs. For this
to work we pass `shell` option to the command which allows for joining
the commands.

### How Has This Been Tested: 
1. Delete rn 75 project and checkout a fresh copy
2. Open the fresh RN 75 project with the IDE
  • Loading branch information
kmagiera authored Oct 15, 2024
1 parent ddd99f8 commit 65cf1e9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions packages/vscode-extension/src/dependency/DependencyManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,14 @@ export class DependencyManager implements Disposable, DependencyManagerInterface
try {
const env = getLaunchConfiguration().env;
const shouldUseBundle = await this.shouldUseBundleCommand();
const process = command(shouldUseBundle ? "bundle exec pod install" : "pod install", {
cwd: iosDirPath,
env: { ...env, LANG: "en_US.UTF-8" },
});
const process = command(
shouldUseBundle ? "bundle install && bundle exec pod install" : "pod install",
{
shell: shouldUseBundle, // when using bundle, we need shell to run multiple commands
cwd: iosDirPath,
env: { ...env, LANG: "en_US.UTF-8" },
}
);
lineReader(process).onLineRead((line) => buildOutputChannel.appendLine(line));
await cancelToken.adapt(process);
} catch (e) {
Expand Down

0 comments on commit 65cf1e9

Please sign in to comment.