Browse Source

using killPort

Daniel Zlotin 7 years ago
parent
commit
8384bb7f93
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      scripts/clean.js
  2. 1
    1
      scripts/start.js

+ 1
- 1
scripts/clean.js View File

@@ -3,7 +3,7 @@ const exec = require('shell-utils').exec;
3 3
 run();
4 4
 
5 5
 function run() {
6
-  exec.execSync('lsof -t -i tcp:8081 | xargs kill || true');
6
+  exec.killPort(8081);
7 7
   exec.execSync(`watchman watch-del-all || true`);
8 8
   exec.execSync(`adb reverse tcp:8081 tcp:8081 || true`);
9 9
   exec.execSync(`rm -rf lib/ios/DerivedData/`);

+ 1
- 1
scripts/start.js View File

@@ -3,7 +3,7 @@ const exec = require('shell-utils').exec;
3 3
 run();
4 4
 
5 5
 function run() {
6
-  exec.kill('8081');
6
+  exec.killPort(8081);
7 7
   exec.execSync(`watchman watch-del-all || true`);
8 8
   exec.execSync(`adb reverse tcp:8081 tcp:8081 || true`);
9 9
   exec.execSync(`node ./node_modules/react-native/local-cli/cli.js start --root=./playground`);