Windows fixes

This commit is contained in:
Scott E. Graves
2018-12-10 13:32:26 -06:00
parent 61b2f6e6f6
commit 29a72f4707
2 changed files with 60 additions and 56 deletions

View File

@@ -198,8 +198,6 @@ module.exports.executeMount = (directory, version, storageType, location, noCons
clearTimeout(timeout);
exitCallback(code, pid);
});
process.unref();
});
};
@@ -466,6 +464,22 @@ module.exports.stopMountProcess = (directory, version, storageType) => {
Code: code,
});
});
process.unref();
});
};
module.exports.stopMountProcessSync = (directory, version, storageType) => {
const processOptions = {
detached: true,
shell: true,
windowsHide: true,
};
const command = path.join(directory, version, (os.platform() === 'win32') ? 'repertory.exe' : 'repertory');
const args = ['-unmount'];
if (Constants.PROVIDER_ARG[storageType.toLowerCase()].length > 0) {
args.push(Constants.PROVIDER_ARG[storageType.toLowerCase()]);
}
const process = new spawn(command, args, processOptions);
process.unref();
};