Browse Source

fix script

Daniel Zlotin 7 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
             -sdk iphonesimulator
23
             -sdk iphonesimulator
24
             -derivedDataPath ./DerivedData/playground`;
24
             -derivedDataPath ./DerivedData/playground`;
25
 
25
 
26
-  if (shellUtils.exec.execSyncRead(`which xcpretty`)) {
26
+  if (hasXcpretty()) {
27
     shellUtils.exec.execSync(`${cmd} | xcpretty && exit ${PIPESTATUS[0]}`);
27
     shellUtils.exec.execSync(`${cmd} | xcpretty && exit ${PIPESTATUS[0]}`);
28
   } else {
28
   } else {
29
     shellUtils.exec.execSync(`${cmd}`);
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
 function e2e() {
40
 function e2e() {
34
   try {
41
   try {