Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Commit

Permalink
fix(deps): Fix the npm audit warning for sync-exec
Browse files Browse the repository at this point in the history
Remove the package, use node's child_process.syncExec instead.

blocks #6595
  • Loading branch information
Shane Tomlinson committed Oct 29, 2018
1 parent a497419 commit eb8afc1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 29 deletions.
6 changes: 0 additions & 6 deletions npm-shrinkwrap.json

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

1 change: 0 additions & 1 deletion package.json
Expand Up @@ -152,7 +152,6 @@
"request": "2.88.0",
"request-promise": "4.2.0",
"sinon": "4.5.0",
"sync-exec": "0.6.2",
"webpack-dev-middleware": "3.1.3",
"xmlhttprequest": "git://github.com/zaach/node-XMLHttpRequest.git#onerror",
"yargs": "10.0.3"
Expand Down
40 changes: 18 additions & 22 deletions tests/tools/firefox_profile.js
@@ -1,31 +1,27 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
const path = require('path');
const exec = require('sync-exec');

var createProfile = function (config) {
var profileProcess = null;
var encodedProfile = '';
const path = require('path');
const childProcess = require('child_process');

if (path) {
console.log('Creating Firefox profile...');
var profileArgs = JSON.stringify(JSON.stringify(config));
var profileTool = path.join('tests', 'tools', 'firefox_profile_creator.js');
try {
profileProcess = exec(['node', profileTool, profileArgs].join(' '));
} catch (e) {
console.log('Note: execSync failed to run:', e);
}
module.exports = function createProfile (config) {
console.log('Creating Firefox profile...');

if (profileProcess && profileProcess.status === 0) {
encodedProfile = profileProcess.stdout;
} else {
console.log('Note: Failed to generate a Firefox profile for this configuration.');
}
let encodedProfile = '';
const profileArgs = JSON.stringify(JSON.stringify(config));
const profileTool = path.join('tests', 'tools', 'firefox_profile_creator.js');
try {
encodedProfile = childProcess.execSync(['node', profileTool, profileArgs].join(' '));
} catch (e) {
console.log('Note: execSync failed to run:', e);
}

return encodedProfile;
if (encodedProfile) {
encodedProfile = encodedProfile.toString('utf8');
} else {
console.log('Note: Failed to generate a Firefox profile for this configuration.');
}
};

module.exports = createProfile;
return encodedProfile;
};

0 comments on commit eb8afc1

Please sign in to comment.