Get Sonar Running on Windows

Summary: Small tweaks so that Sonar can be started easily on windows.

Reviewed By: danielbuechele

Differential Revision: D8769592

fbshipit-source-id: 084dd50e5600a7e2e9c5544e3e79a18614933fdc
This commit is contained in:
Aaron Brady
2018-07-11 08:06:41 -07:00
committed by Facebook Github Bot
parent 9f95698492
commit a223edafaa
4 changed files with 42 additions and 12 deletions

View File

@@ -7,7 +7,7 @@
const glob = require('glob');
const path = require('path');
const {spawn} = require('child_process');
const {exec} = require('child_process');
const PACKAGES = ['static', 'src/plugins/*', 'src/fb/plugins/*'];
const WINDOWS = /^win/.test(process.platform);
const YARN_PATH =
@@ -36,13 +36,21 @@ Promise.all(
Promise.all(
packages.reduce((acc, cv) => acc.concat(cv), []).map(
pkg =>
new Promise(resolve => {
new Promise((resolve, reject) => {
const cwd = pkg.replace('/package.json', '');
const yarn = spawn(YARN_PATH, ['--mutex', 'file'], {
cwd,
});
yarn.stderr.on('data', e => console.error(e.toString()));
yarn.on('close', code => resolve(code));
exec(
[YARN_PATH, '--mutex', 'file'].join(' '),
{
cwd,
},
(err, stderr, stdout) => {
if (err) {
reject(err);
} else {
resolve(0);
}
},
);
}),
),
),