Skip to content

Commit

Permalink
Merge pull request #1630 from Adslot/babel-build
Browse files Browse the repository at this point in the history
fix: fix codeql scan issue
  • Loading branch information
pphminions committed Jun 15, 2023
2 parents 83d9bae + f2026a2 commit 4f6fc0c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/babel-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const childProcess = require('child_process');
const path = require('path');
const { promisify } = require('util');

const exec = promisify(childProcess.exec);
const execFile = promisify(childProcess.execFile);

const outDirs = {
esm: 'es',
Expand Down Expand Up @@ -34,9 +34,10 @@ async function run() {
`"${ignore.join('","')}"`,
];

const command = ['npx babel', ...babelArgs].join(' ');
const command = 'npx';
const args = ['babel', ...babelArgs];

const { stderr } = await exec(command, { env: { ...process.env, ...env } });
const { stderr } = await execFile(command, args, { env: { ...process.env, ...env } });
if (stderr) {
throw new Error(`'${command}' failed with \n${stderr}`);
}
Expand Down

0 comments on commit 4f6fc0c

Please sign in to comment.