Browse Source

clean script

Daniel Zlotin 7 years ago
parent
commit
076e08ec10
2 changed files with 14 additions and 0 deletions
  1. 1
    0
      package.json
  2. 13
    0
      scripts/clean.js

+ 1
- 0
package.json View File

@@ -29,6 +29,7 @@
29 29
     "xcode": "open playground/ios/playground.xcodeproj",
30 30
     "install-android": "cd playground/android && ./gradlew installDebug",
31 31
     "uninstall-android": "cd playground/android && ./gradlew uninstallAll",
32
+    "clean": "node ./scripts/clean.js",
32 33
     "start": "node ./scripts/start.js",
33 34
     "test-js": "node ./scripts/test-js.js",
34 35
     "test-unit-android": "node ./scripts/test.unit.android.js",

+ 13
- 0
scripts/clean.js View File

@@ -0,0 +1,13 @@
1
+const exec = require('shell-utils').exec;
2
+
3
+run();
4
+
5
+function run() {
6
+  exec.kill('8081');
7
+  exec.execSync(`watchman watch-del-all || true`);
8
+  exec.execSync(`adb reverse tcp:8081 tcp:8081 || true`);
9
+  exec.execSync(`rm -rf lib/ios/DerivedData/`);
10
+  exec.execSync(`rm -rf playground/ios/DerivedData/`);
11
+  exec.execSync(`cd lib/android && ./gradlew clean`);
12
+  exec.execSync(`cd playground/android && ./gradlew clean`);
13
+}