Browse Source

fix script

Daniel Zlotin 8 years ago
parent
commit
d2fd07d9a3
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      playground/scripts/e2e.ios.js

+ 8
- 1
playground/scripts/e2e.ios.js View File

@@ -23,12 +23,19 @@ function buildProjForDetox() {
23 23
             -sdk iphonesimulator
24 24
             -derivedDataPath ./DerivedData/playground`;
25 25
 
26
-  if (shellUtils.exec.execSyncRead(`which xcpretty`)) {
26
+  if (hasXcpretty()) {
27 27
     shellUtils.exec.execSync(`${cmd} | xcpretty && exit ${PIPESTATUS[0]}`);
28 28
   } else {
29 29
     shellUtils.exec.execSync(`${cmd}`);
30 30
   }
31 31
 }
32
+function hasXcpretty() {
33
+  try {
34
+    return shellUtils.exec.execSyncRead(`which xcpretty`);
35
+  } catch (e) {
36
+    return false;
37
+  }
38
+}
32 39
 
33 40
 function e2e() {
34 41
   try {