mirror of https://github.com/keeweb/keeweb.git
added a hook for rcedit while wine is not working on macOS
This commit is contained in:
parent
b944e36d5c
commit
dc6afb765a
|
@ -5,6 +5,9 @@ const path = require('path');
|
||||||
|
|
||||||
const webpackConfig = require('./build/webpack.config');
|
const webpackConfig = require('./build/webpack.config');
|
||||||
const pkg = require('./package.json');
|
const pkg = require('./package.json');
|
||||||
|
const hookRcedit = require('./build/util/hook-rcedit');
|
||||||
|
|
||||||
|
hookRcedit.setup();
|
||||||
|
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
require('time-grunt')(grunt);
|
require('time-grunt')(grunt);
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
const childProcess = require('child_process');
|
||||||
|
|
||||||
|
// remove this once wine can be run on macOS
|
||||||
|
|
||||||
|
const childProcessSpawn = childProcess.spawn;
|
||||||
|
|
||||||
|
function hookedSpawn(command, options) {
|
||||||
|
if (command === 'wine') {
|
||||||
|
options = options.map(option => {
|
||||||
|
if (option.includes(' ')) {
|
||||||
|
option = `"${option.replace('"', '\\"')}"`;
|
||||||
|
}
|
||||||
|
return option;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return childProcessSpawn.call(childProcess, command, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports.setup = function() {
|
||||||
|
childProcess.spawn = hookedSpawn;
|
||||||
|
};
|
Loading…
Reference in New Issue