Browse Source

try fix travis

Daniel Zlotin 7 years ago
parent
commit
255713dc72
1 changed files with 20 additions and 20 deletions
  1. 20
    20
      scripts/start.js

+ 20
- 20
scripts/start.js View File

@@ -3,27 +3,27 @@ const exec = require('shell-utils').exec;
3 3
 run();
4 4
 
5 5
 function run() {
6
-  const port = findPort();
6
+  exec.kill('8081');
7 7
   exec.execSync(`watchman watch-del-all || true`);
8
-  exec.execSync(`adb reverse tcp:${port} tcp:${port} || true`);
9
-  exec.execSync(`node ./node_modules/react-native/local-cli/cli.js start --port=${port} --root=./playground`);
8
+  exec.execSync(`adb reverse tcp:8081 tcp:8081 || true`);
9
+  exec.execSync(`node ./node_modules/react-native/local-cli/cli.js start --root=./playground`);
10 10
 }
11 11
 
12
-function findPort() {
13
-  let port = 8081;
14
-  if (!process.env.CI) {
15
-    return port;
16
-  }
17
-  while (!isPortOpen(port)) {
18
-    port = Number((Math.random() * 1000).toFixed(0)) + 35000;
19
-  }
20
-  return port;
21
-}
12
+// function findPort() {
13
+//   let port = 8081;
14
+//   if (!process.env.CI) {
15
+//     return port;
16
+//   }
17
+//   while (!isPortOpen(port)) {
18
+//     port = Number((Math.random() * 1000).toFixed(0)) + 35000;
19
+//   }
20
+//   return port;
21
+// }
22 22
 
23
-function isPortOpen(port) {
24
-  try {
25
-    return !exec.execSyncRead(`netstat -vanp tcp | grep ${port}`);
26
-  } catch (e) {
27
-    return true;
28
-  }
29
-}
23
+// function isPortOpen(port) {
24
+//   try {
25
+//     return !exec.execSyncRead(`netstat -vanp tcp | grep ${port}`);
26
+//   } catch (e) {
27
+//     return true;
28
+//   }
29
+// }