Skip to content

Commit

Permalink
use execa
Browse files Browse the repository at this point in the history
  • Loading branch information
runspired committed Aug 14, 2018
1 parent 6bad00e commit e5a4764
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
13 changes: 5 additions & 8 deletions lib/scripts/test-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/* eslint-disable no-console, node/no-extraneous-require, node/no-unpublished-require */
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const { shellSync } = require('execa');
// apparently violates no-extraneous require? /shrug
const debug = require('debug')('test-external');
const rimraf = require('rimraf');
Expand All @@ -24,15 +24,15 @@ if (!gitUrl) {
}

console.log(
`Testing external project ${externalProjectName} located at ${gitUrl} against this ember-data commit.`
`Preparing to test external project ${externalProjectName} located at ${gitUrl} against this ember-data commit.`
);

function execWithLog(command, force) {
if (debug.enabled || force) {
return execSync(command, { stdio: [0, 1, 2] });
return shellSync(command, { stdio: [0, 1, 2] });
}

return execSync(command);
return shellSync(command);
}

if (!fs.existsSync(tempDir)) {
Expand Down Expand Up @@ -98,10 +98,7 @@ try {

try {
debug('Re-running tests against EmberData commit');
execWithLog(
`cd ../__external-test-cache/${externalProjectName} && ember test`,
true
);
execWithLog(`cd ../__external-test-cache/${externalProjectName} && ember test`, true);
} catch (e) {
commitTestPassed = false;
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-node": "^7.0.1",
"eslint-plugin-prettier": "2.6.2",
"execa": "^0.10.0",
"fs-extra": "^7.0.0",
"github": "^1.1.1",
"glob": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3157,7 +3157,7 @@ exec-sh@^0.2.0:

execa@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50"
resolved "https://registry.npmjs.org/execa/-/execa-0.10.0.tgz#ff456a8f53f90f8eccc71a96d11bdfc7f082cb50"
dependencies:
cross-spawn "^6.0.0"
get-stream "^3.0.0"
Expand Down

0 comments on commit e5a4764

Please sign in to comment.