react-native-navigation的迁移库

1234567891011121314151617181920212223242526272829303132333435
  1. const _ = require('lodash');
  2. const shellUtils = require('shell-utils');
  3. const fs = require('fs');
  4. function testProject() {
  5. shellUtils.exec.execSync(`echo 'travis_fold:start:xcodeunit'`);
  6. const cmd = `RCT_NO_LAUNCH_PACKAGER=true
  7. cd ios && xcodebuild
  8. test
  9. -scheme "playground"
  10. -project playground.xcodeproj
  11. -destination 'platform=iOS Simulator,name=iPhone 7'
  12. `;
  13. if (hasXcpretty()) {
  14. shellUtils.exec.execSync(`${cmd} | xcpretty && exit \${PIPESTATUS[0]}`);
  15. } else {
  16. shellUtils.exec.execSync(`${cmd}`);
  17. }
  18. shellUtils.exec.execSync(`echo 'travis_fold:end:xcodeunit'`);
  19. }
  20. function hasXcpretty() {
  21. try {
  22. return shellUtils.exec.execSyncRead(`which xcpretty`);
  23. } catch (e) {
  24. return false;
  25. }
  26. }
  27. function run() {
  28. testProject();
  29. }
  30. run();