Fix Unix binary execution

This commit is contained in:
2020-02-11 19:40:35 -06:00
parent 4a59d27ed7
commit f4f9636405

View File

@@ -82,7 +82,7 @@ const _getDefaultRepertoryArgs = (provider, remote) => {
const _getRepertoryExec = version => {
return {
cmd: (os.platform() === 'win32') ? 'repertory.exe' : 'repertory',
cmd: (os.platform() === 'win32') ? 'repertory.exe' : './repertory',
working: path.join(_getDataDirectory(), version),
};
};
@@ -288,7 +288,7 @@ module.exports.executeAndWait = (command, ignoreResult) => {
module.exports.executeAsync = (command, args=[]) => {
return new Promise((resolve, reject) => {
const launchProcess = (count, timeout) => {
const cmd = path.basename(command);
let cmd = path.basename(command);
const working = cmd.length === command.length ? null : command.substr(0, command.length - cmd.length);
let processOptions = {
detached: true,
@@ -296,6 +296,7 @@ module.exports.executeAsync = (command, args=[]) => {
};
if (working) {
processOptions.cwd = working;
cmd = './' + cmd;
}
const process = new spawn(cmd, args, processOptions);