Skip to content

Commit

Permalink
chore: replace superspawn with execa
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu authored and raphinesse committed Nov 1, 2021
1 parent 1b2e2e7 commit 42cb66c
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 8 deletions.
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
under the License.
*/

const execa = require('execa');
const pify = require('pify');
const which = pify(require('which'));
const path = require('path');
const fs = require('fs-extra');
const { CordovaError, events, superspawn } = require('cordova-common');
const { CordovaError, events } = require('cordova-common');
const npa = require('npm-package-arg');
const pacote = require('pacote');
const semver = require('semver');
Expand Down Expand Up @@ -84,7 +85,7 @@ async function installPackage (target, dest, opts) {
// Run `npm` to install requested package
const args = npmArgs(target, opts);
events.emit('verbose', `fetch: Installing ${target} to ${dest}`);
await superspawn.spawn('npm', args, { cwd: dest });
return execa('npm', args, { cwd: dest });
}

function npmArgs (target, opts) {
Expand Down Expand Up @@ -162,7 +163,7 @@ module.exports.uninstall = async (target, dest, opts) => {

// run npm uninstall, this will remove dependency
// from package.json if --save was used.
return superspawn.spawn('npm', fetchArgs, opts);
return execa('npm', fetchArgs, opts);
} catch (err) {
throw new CordovaError(err);
}
Expand Down
51 changes: 46 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"license": "Apache-2.0",
"dependencies": {
"cordova-common": "^4.0.0",
"execa": "^5.1.1",
"fs-extra": "^9.0.0",
"npm-package-arg": "^8.0.1",
"pacote": "^11.1.11",
Expand Down

0 comments on commit 42cb66c

Please sign in to comment.