Skip to content

Commit

Permalink
fix: support esm execa
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelly Selden committed Nov 9, 2023
1 parent 28339fb commit ead90e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/cp.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict';

const debug = require('./debug');
const execa = require('execa');

function spawn() {
async function spawn() {
const { execa } = await import('execa');

debug(...arguments);

let ps = execa(...arguments);
Expand Down
7 changes: 6 additions & 1 deletion test/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
const { describe, it } = require('./helpers/mocha');
const { expect } = require('./helpers/chai');
const { gitInit } = require('git-fixtures');
const execa = require('execa');
const fs = require('fs');
const { promisify } = require('util');
const copyFile = promisify(fs.copyFile);
const path = require('path');

const bin = require.resolve('../bin');

async function execa() {
const { execa } = await import('execa');

return execa(...arguments);
}

describe(function() {
let tmpPath;

Expand Down

0 comments on commit ead90e3

Please sign in to comment.