12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- const shellUtils = require('shell-utils');
-
- function installNavigation() {
- shellUtils.exec.execSync(`mkdir -p ./node_modules/react-native-navigation`);
- const navigationTar = shellUtils.exec.execSyncRead(`cd .. && npm pack`);
- shellUtils.exec.execSync(`tar -xf ../${navigationTar} -C ./node_modules/react-native-navigation --strip 1`);
- shellUtils.exec.execSync(`rm ../${navigationTar}`);
-
- if (!process.env.CI) {
- hardlinkNavigation();
- }
- }
-
- function copyNodeModulesFromNavigation() {
- shellUtils.exec.execSync(`cp -Rf ../node_modules ./`);
- }
-
- function removeHardlinks() {
- shellUtils.exec.execSync(`hardlink ./node_modules/react-native-navigation/ -u || true`);
- }
-
- function removeNodeModules() {
- shellUtils.exec.execSync(`rm -rf ./node_modules || true`);
- }
-
- function ignoreReactWarnings() {
- shellUtils.exec.execSync(`./scripts/ignoreReactWarnings.rb`);
- }
-
- function hardlinkNavigation() {
- shellUtils.exec.execSync(`hardlink ../ ./node_modules/react-native-navigation/ || true`);
- }
-
- function fixRN38() {
- shellUtils.exec.execSync(`node ./scripts/fixRN38.js`);
- }
-
- function run() {
- removeHardlinks();
- removeNodeModules();
- copyNodeModulesFromNavigation();
- installNavigation();
- ignoreReactWarnings();
- fixRN38();
- }
-
- run();
-
|