react-native-navigation的迁移库

quickInstall.js 910B

123456789101112131415161718192021222324252627
  1. const shellUtils = require('shell-utils');
  2. function installNavigation() {
  3. shellUtils.exec.execSync(`mkdir -p ./node_modules/react-native-navigation`);
  4. const navigationTar = shellUtils.exec.execSyncRead(`cd .. && npm pack`);
  5. shellUtils.exec.execSync(`tar -xf ../${navigationTar} -C ./node_modules/react-native-navigation --strip 1`);
  6. shellUtils.exec.execSync(`rm ../${navigationTar}`);
  7. }
  8. function copyNodeModulesFromNavigation() {
  9. shellUtils.exec.execSync(`cp -rf ../node_modules ./`);
  10. }
  11. function run() {
  12. exec.execSyncSilent(`hardlink ./node_modules/react-native-navigation/ -u || true`);
  13. exec.execSyncSilent(`rm -rf ./node_modules || true`);
  14. copyNodeModulesFromNavigation();
  15. installNavigation();
  16. shellUtils.exec.execSync(`./scripts/ignoreReactWarnings.rb`);
  17. if (!process.env.CI) {
  18. exec.execSyncSilent(`hardlink ../ ./node_modules/react-native-navigation/ || true`);
  19. }
  20. }
  21. run();