Skip to content

Commit

Permalink
use existing fn
Browse files Browse the repository at this point in the history
  • Loading branch information
pankaj443 committed Feb 28, 2024
1 parent 7e58ac9 commit d57d8aa
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/cli-exec/src/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import start from './start.js';
import stop from './stop.js';
import ping from './ping.js';
import { getPackageJSON } from '@percy/cli-command/utils';
import { waitForTimeout } from '@percy/client/utils';

const pkg = getPackageJSON(import.meta.url);

Expand Down Expand Up @@ -92,14 +93,11 @@ export const exec = command('exec', {
await percy?.stop(!!error);

// forward any returned status code
if (status) {
exit(status, error);
} else {
// force exit post timeout
setTimeout(function() {
process.exit(0);
}, 10000);
}
if (status) exit(status, error);

// force exit post timeout
await waitForTimeout(10000);
process.exit(status);
});

// Spawn a command with cross-spawn and return an array containing the resulting status code along
Expand Down

0 comments on commit d57d8aa

Please sign in to comment.