1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-27 23:28:38 +02:00

Tools: Fixed building Android app on Windows

This commit is contained in:
Laurent Cozic
2019-10-13 01:21:56 +02:00
parent 9f5da92ab4
commit a3e7f0b5ef
2 changed files with 50 additions and 18 deletions

View File

@ -4,7 +4,7 @@ toolUtils.execCommand = function(command) {
const exec = require('child_process').exec;
return new Promise((resolve, reject) => {
exec(command, (error, stdout) => {
const child = exec(command, (error, stdout) => {
if (error) {
if (error.signal == 'SIGTERM') {
resolve('Process was killed');
@ -15,6 +15,29 @@ toolUtils.execCommand = function(command) {
resolve(stdout.trim());
}
});
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
});
};
toolUtils.execCommandWithPipes = function(executable, args) {
var spawn = require('child_process').spawn;
return new Promise((resolve, reject) => {
const child = spawn(executable, args, { stdio: 'inherit'});
child.on('error', (error) => {
reject(error);
});
child.on('close', (code) => {
if (code !== 0) {
reject(`Ended with code ${code}`);
} else {
resolve();
}
});
});
};