Remove child-process-es6-promise

Summary:
We're using two libraries to do the same thing.
The other one is better.

Reviewed By: mweststrate

Differential Revision: D18954485

fbshipit-source-id: 33ed2f452badf30cb72c69661527edc54708efba
This commit is contained in:
Pascal Hartig
2020-01-13 08:09:50 -08:00
committed by Facebook Github Bot
parent 61df5de3ed
commit acc2f293bd
4 changed files with 12 additions and 15 deletions

View File

@@ -130,7 +130,6 @@
"ansi-to-html": "^0.6.3",
"async-mutex": "^0.1.3",
"chalk": "^3.0.0",
"child-process-es6-promise": "^1.2.1",
"codemirror": "^5.25.0",
"cross-env": "^6.0.3",
"dashify": "^2.0.0",

View File

@@ -11,7 +11,7 @@ const path = require('path');
const fs = require('fs-extra');
const builder = require('electron-builder');
const Platform = builder.Platform;
const cp = require('child-process-es6-promise');
const cp = require('promisify-child-process');
const {
buildFolder,
compile,
@@ -62,15 +62,16 @@ function modifyPackageManifest(buildFolder, versionNumber, hgRevision) {
);
}
function buildDist(buildFolder) {
async function buildDist(buildFolder) {
const targetsRaw = [];
const postBuildCallbacks = [];
if (process.argv.indexOf('--mac') > -1) {
targetsRaw.push(Platform.MAC.createTarget(['dir']));
postBuildCallbacks.push(() =>
cp.spawn('zip', ['-yr9', '../Flipper-mac.zip', 'Flipper.app'], {
cp.spawn('zip', ['-qyr9', '../Flipper-mac.zip', 'Flipper.app'], {
cwd: path.join(__dirname, '..', 'dist', 'mac'),
encoding: 'utf-8',
}),
);
}
@@ -96,8 +97,8 @@ function buildDist(buildFolder) {
electronDownload.cache = process.env.electron_config_cache;
}
return builder
.build({
try {
await builder.build({
publish: 'never',
config: {
appId: `com.facebook.sonar`,
@@ -110,9 +111,11 @@ function buildDist(buildFolder) {
},
projectDir: buildFolder,
targets,
})
.then(() => Promise.all(postBuildCallbacks.map(p => p())))
.catch(die);
});
return await Promise.all(postBuildCallbacks.map(p => p()));
} catch (err) {
return die(err);
}
}
function copyStaticFolder(buildFolder) {

View File

@@ -12,7 +12,7 @@ const compilePlugins = require('../static/compilePlugins');
const tmp = require('tmp');
const path = require('path');
const fs = require('fs-extra');
const cp = require('child-process-es6-promise');
const cp = require('promisify-child-process');
function die(err) {
console.error(err.stack);

View File

@@ -2541,11 +2541,6 @@ chardet@^0.7.0:
resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e"
integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==
child-process-es6-promise@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/child-process-es6-promise/-/child-process-es6-promise-1.2.1.tgz#3634950521b49d5cad9735cbcc8d69cf1e4d0cab"
integrity sha512-ekKf2tD+2B2AZvLBhrBb44oelJSjeBkG3dZHpF5oIC9xhePhI3cAMqxyAxLMmskpc81GfCodSRh29wshnsOd/g==
chownr@^1.1.1, chownr@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142"