mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
change export syntax in app/plugins/install.js
This commit is contained in:
parent
0381f392de
commit
acbf06e4ac
1 changed files with 38 additions and 40 deletions
|
|
@ -3,48 +3,46 @@ import queue from 'queue';
|
||||||
import ms from 'ms';
|
import ms from 'ms';
|
||||||
import {yarn, plugs} from '../config/paths';
|
import {yarn, plugs} from '../config/paths';
|
||||||
|
|
||||||
export default {
|
export const install = fn => {
|
||||||
install: fn => {
|
const spawnQueue = queue({concurrency: 1});
|
||||||
const spawnQueue = queue({concurrency: 1});
|
function yarnFn(args, cb) {
|
||||||
function yarnFn(args, cb) {
|
const env = {
|
||||||
const env = {
|
NODE_ENV: 'production',
|
||||||
NODE_ENV: 'production',
|
ELECTRON_RUN_AS_NODE: 'true'
|
||||||
ELECTRON_RUN_AS_NODE: 'true'
|
};
|
||||||
};
|
spawnQueue.push(end => {
|
||||||
spawnQueue.push(end => {
|
const cmd = [process.execPath, yarn].concat(args).join(' ');
|
||||||
const cmd = [process.execPath, yarn].concat(args).join(' ');
|
//eslint-disable-next-line no-console
|
||||||
//eslint-disable-next-line no-console
|
console.log('Launching yarn:', cmd);
|
||||||
console.log('Launching yarn:', cmd);
|
|
||||||
|
|
||||||
cp.execFile(
|
cp.execFile(
|
||||||
process.execPath,
|
process.execPath,
|
||||||
[yarn].concat(args),
|
[yarn].concat(args),
|
||||||
{
|
{
|
||||||
cwd: plugs.base,
|
cwd: plugs.base,
|
||||||
env,
|
env,
|
||||||
timeout: ms('5m'),
|
timeout: ms('5m'),
|
||||||
maxBuffer: 1024 * 1024
|
maxBuffer: 1024 * 1024
|
||||||
},
|
},
|
||||||
(err, stdout, stderr) => {
|
(err, stdout, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
cb(stderr);
|
cb(stderr);
|
||||||
} else {
|
} else {
|
||||||
cb(null);
|
cb(null);
|
||||||
}
|
|
||||||
end();
|
|
||||||
spawnQueue.start();
|
|
||||||
}
|
}
|
||||||
);
|
end();
|
||||||
});
|
spawnQueue.start();
|
||||||
|
}
|
||||||
spawnQueue.start();
|
);
|
||||||
}
|
|
||||||
|
|
||||||
yarnFn(['install', '--no-emoji', '--no-lockfile', '--cache-folder', plugs.cache], err => {
|
|
||||||
if (err) {
|
|
||||||
return fn(err);
|
|
||||||
}
|
|
||||||
fn(null);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
spawnQueue.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
yarnFn(['install', '--no-emoji', '--no-lockfile', '--cache-folder', plugs.cache], err => {
|
||||||
|
if (err) {
|
||||||
|
return fn(err);
|
||||||
|
}
|
||||||
|
fn(null);
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue