Move getBlhostCmd() from shared.js to uhk.js

This commit is contained in:
László Monda
2018-01-30 21:35:35 +01:00
parent 73e07eae2d
commit 288d4f75b6
4 changed files with 25 additions and 25 deletions

View File

@@ -1,27 +1,5 @@
require('shelljs/global');
function getBlhostCmd(pid) {
let blhostPath;
switch (process.platform) {
case 'linux':
const arch = exec('uname -m', {silent:true}).stdout.trim();
blhostPath = `linux/${arch}/blhost`;
break;
case 'darwin':
blhostPath = 'mac/blhost';
break;
case 'win32':
blhostPath = 'win/blhost.exe';
break;
default:
echo('Your operating system is not supported.');
exit(1);
break;
}
return `${__dirname}/blhost/${blhostPath} --usb 0x1d50,0x${pid.toString(16)}`;
}
function execRetry(command) {
let firstRun = true;
let remainingRetries = 3;
@@ -38,7 +16,6 @@ function execRetry(command) {
}
const exp = {
getBlhostCmd,
execRetry,
}