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

@@ -44,6 +44,7 @@
"ansi-to-html": "^0.6.3",
"chalk": "^2.3.0",
"codemirror": "^5.25.0",
"cross-env": "^5.2.0",
"dashify": "^1.0.0",
"deep-equal": "^1.0.1",
"detect-port": "^1.1.1",
@@ -78,8 +79,8 @@
"rm-modules": "rm -rf node_modules static/node_modules",
"rm-temp": "rm -rf $TMPDIR/jest* $TMPDIR/react-native-packager*",
"reset": "yarn cache clean && yarn rm-dist && yarn rm-modules && yarn rm-temp",
"start": "NODE_ENV=development node scripts/start-dev-server.js",
"build": "yarn rm-dist && NODE_ENV=production node scripts/build-release.js $@",
"start": "cross-env NODE_ENV=development node scripts/start-dev-server.js",
"build": "yarn rm-dist && cross-env NODE_ENV=production node scripts/build-release.js $@",
"fix": "eslint . --fix",
"lint": "eslint . && flow check"
},

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'], {
exec(
[YARN_PATH, '--mutex', 'file'].join(' '),
{
cwd,
});
yarn.stderr.on('data', e => console.error(e.toString()));
yarn.on('close', code => resolve(code));
},
(err, stderr, stdout) => {
if (err) {
reject(err);
} else {
resolve(0);
}
},
);
}),
),
),

View File

@@ -171,7 +171,7 @@ export default class CertificateProvider {
),
);
}
if (os === 'iOS') {
if (os === 'iOS' || os === 'windows') {
fs.writeFileSync(destination + filename, contents);
return Promise.resolve();
}

View File

@@ -1088,6 +1088,13 @@ create-error-class@^3.0.0:
dependencies:
capture-stack-trace "^1.0.0"
cross-env@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"
cross-spawn@^5.0.1, cross-spawn@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
@@ -1096,6 +1103,16 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0:
shebang-command "^1.2.0"
which "^1.2.9"
cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
dependencies:
nice-try "^1.0.4"
path-key "^2.0.1"
semver "^5.5.0"
shebang-command "^1.2.0"
which "^1.2.9"
cross-unzip@0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/cross-unzip/-/cross-unzip-0.0.2.tgz#5183bc47a09559befcf98cc4657964999359372f"
@@ -2635,7 +2652,7 @@ is-utf8@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
is-windows@^1.0.2:
is-windows@^1.0.0, is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
@@ -3478,6 +3495,10 @@ negotiator@0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.1.tgz#2b327184e8992101177b28563fb5e7102acd0ca9"
nice-try@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4"
node-fetch@^1.0.1:
version "1.7.3"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.3.tgz#980f6f72d85211a5347c6b2bc18c5b84c3eb47ef"
@@ -3794,7 +3815,7 @@ path-is-inside@^1.0.1, path-is-inside@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53"
path-key@^2.0.0:
path-key@^2.0.0, path-key@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40"