Browse Source

quickInstall

Daniel Zlotin 7 years ago
parent
commit
865811b3e0
3 changed files with 13 additions and 5 deletions
  1. 1
    1
      playground/package.json
  2. 11
    2
      playground/scripts/quickInstall.js
  3. 1
    2
      scripts/test.ios.js

+ 1
- 1
playground/package.json View File

3
   "version": "1.0.0",
3
   "version": "1.0.0",
4
   "private": true,
4
   "private": true,
5
   "scripts": {
5
   "scripts": {
6
-    "postinstall": "node ./scripts/postinstall.js",
6
+    "quickinstall": "node ./scripts/quickInstall.js",
7
     "start": "adb reverse tcp:8081 tcp:8081; watchman watch-del-all; react-native start --reset-cache",
7
     "start": "adb reverse tcp:8081 tcp:8081; watchman watch-del-all; react-native start --reset-cache",
8
     "xcode": "open ios/playground.xcodeproj",
8
     "xcode": "open ios/playground.xcodeproj",
9
     "android": "cd android && ./gradlew installDebug",
9
     "android": "cd android && ./gradlew installDebug",

playground/scripts/postinstall.js → playground/scripts/quickInstall.js View File

7
   shellUtils.exec.execSync(`rm ../${navigationTar}`);
7
   shellUtils.exec.execSync(`rm ../${navigationTar}`);
8
 }
8
 }
9
 
9
 
10
-function run() {
10
+function copyNodeModulesFromNavigation() {
11
   shellUtils.exec.execSync(`cp -rf ../node_modules ./`);
11
   shellUtils.exec.execSync(`cp -rf ../node_modules ./`);
12
-  shellUtils.exec.execSync(`./scripts/ignoreReactWarnings.rb`);
12
+}
13
+
14
+function run() {
15
+  exec.execSyncSilent(`hardlink ./node_modules/react-native-navigation/ -u || true`);
16
+  exec.execSyncSilent(`rm -rf ./node_modules || true`);
17
+  copyNodeModulesFromNavigation();
13
   installNavigation();
18
   installNavigation();
19
+  shellUtils.exec.execSync(`./scripts/ignoreReactWarnings.rb`);
20
+  if (!process.env.CI) {
21
+    exec.execSyncSilent(`hardlink ../ ./node_modules/react-native-navigation/ || true`);
22
+  }
14
 }
23
 }
15
 
24
 
16
 run();
25
 run();

+ 1
- 2
scripts/test.ios.js View File

2
 
2
 
3
 function run() {
3
 function run() {
4
   process.chdir('./playground');
4
   process.chdir('./playground');
5
-  exec.execSync(`hardlink node_modules/react-native-navigation/ -u || true`);
6
-  exec.execSync(`yarn install`);
5
+  exec.execSync(`yarn run quickinstall`);
7
   exec.execSync(`yarn run e2e release`);
6
   exec.execSync(`yarn run e2e release`);
8
   process.chdir('../');
7
   process.chdir('../');
9
 }
8
 }