Skip to content

Commit 51f728c

Browse files
committed
fix circular reference
1 parent 4523e17 commit 51f728c

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

packages/cli-tools/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"access": "public"
88
},
99
"dependencies": {
10-
"@react-native-community/cli-doctor": "12.0.0-alpha.11",
1110
"appdirsjs": "^1.2.4",
1211
"chalk": "^4.1.2",
1312
"find-up": "^5.0.0",

packages/cli-tools/src/resolveTransitiveDeps.ts

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {installPods} from '@react-native-community/cli-doctor';
21
import fs from 'fs-extra';
32
import path from 'path';
43
import * as fetch from 'npm-registry-fetch';
@@ -9,6 +8,7 @@ import semver from 'semver';
98
import generateFileHash from './generateFileHash';
109
import {getLoader} from './loader';
1110
import logger from './logger';
11+
import {CLIError} from './errors';
1212

1313
export interface DependencyData {
1414
path: string;
@@ -21,6 +21,26 @@ function isUsingYarn(root: string) {
2121
return fs.existsSync(path.join(root, 'yarn.lock'));
2222
}
2323

24+
async function podInstall() {
25+
process.chdir('ios');
26+
const loader = getLoader();
27+
try {
28+
loader.start('Installing pods...');
29+
await execa('bundle', ['exec', 'pod', 'install']);
30+
loader.succeed();
31+
} catch (error) {
32+
const stderr = (error as any).stderr || (error as any).stdout;
33+
loader.fail();
34+
logger.error(stderr);
35+
36+
throw new CLIError(
37+
'Could not install pods. Try running pod installation manually.',
38+
);
39+
} finally {
40+
process.chdir('..');
41+
}
42+
}
43+
2444
function writeFile(filePath: string, content: string) {
2545
fs.writeFileSync(filePath, content, {encoding: 'utf8'});
2646
}
@@ -380,10 +400,7 @@ async function resolvePodsInstallation() {
380400
});
381401

382402
if (install) {
383-
const loader = getLoader({text: 'Installing pods...'});
384-
loader.start();
385-
await installPods(loader);
386-
loader.succeed();
403+
await podInstall();
387404
}
388405
}
389406

0 commit comments

Comments
 (0)