feat(react-native): run pod commands with bundler (#19727)
Signed-off-by: Stefano Formicola <stefano.formicola@cloudacademy.com> Co-authored-by: Stefano Formicola <stefano.formicola@cloudacademy.com>
This commit is contained in:
parent
2c850cfd27
commit
1f903ed924
@ -25,6 +25,11 @@
|
||||
"description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"useBundler": {
|
||||
"description": "Run cocoapods within a Bundler environment, i.e. with the `bundle exec pod install` command",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": ["buildFolder"],
|
||||
|
||||
@ -2,4 +2,5 @@ export interface ReactNativePodInstallOptions {
|
||||
buildFolder: string; // default is './build'
|
||||
repoUpdate: boolean; // default is false
|
||||
deployment: boolean; // default is false
|
||||
useBundler: boolean; // default is false
|
||||
}
|
||||
|
||||
@ -22,6 +22,11 @@
|
||||
"description": "Disallow any changes to the Podfile or the Podfile.lock during installation.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"useBundler": {
|
||||
"description": "Run cocoapods within a Bundler environment, i.e. with the `bundle exec pod install` command",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": ["buildFolder"]
|
||||
|
||||
@ -28,10 +28,12 @@ export function runPodInstall(
|
||||
buildFolder?: string;
|
||||
repoUpdate?: boolean;
|
||||
deployment?: boolean;
|
||||
useBundler?: boolean;
|
||||
} = {
|
||||
buildFolder: './build',
|
||||
repoUpdate: false,
|
||||
deployment: false,
|
||||
useBundler: false,
|
||||
}
|
||||
): GeneratorCallback {
|
||||
return () => {
|
||||
@ -57,10 +59,12 @@ export function podInstall(
|
||||
buildFolder?: string;
|
||||
repoUpdate?: boolean;
|
||||
deployment?: boolean;
|
||||
useBundler?: boolean;
|
||||
} = {
|
||||
buildFolder: './build',
|
||||
repoUpdate: false,
|
||||
deployment: false,
|
||||
useBundler: false,
|
||||
}
|
||||
) {
|
||||
try {
|
||||
@ -70,15 +74,15 @@ export function podInstall(
|
||||
stdio: 'inherit',
|
||||
});
|
||||
}
|
||||
execSync(
|
||||
`pod install ${options.repoUpdate ? '--repo-update' : ''} ${
|
||||
options.deployment ? '--deployment' : ''
|
||||
}`,
|
||||
{
|
||||
cwd: iosDirectory,
|
||||
stdio: 'inherit',
|
||||
}
|
||||
);
|
||||
const podCommand = [
|
||||
options.useBundler ? 'bundle exec pod install' : 'pod install',
|
||||
options.repoUpdate ? '--repo-update' : '',
|
||||
options.deployment ? '--deployment' : '',
|
||||
].join(' ');
|
||||
execSync(podCommand, {
|
||||
cwd: iosDirectory,
|
||||
stdio: 'inherit',
|
||||
});
|
||||
} catch (e) {
|
||||
logger.error(podInstallErrorMessage);
|
||||
throw e;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user