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

This commit is contained in:
László Monda
2018-01-30 21:28:00 +01:00
parent 8e620caac5
commit 73e07eae2d
4 changed files with 20 additions and 20 deletions

View File

@@ -1,22 +1,5 @@
require('shelljs/global');
function checkFirmwareImage(imagePath, extension) {
if (!imagePath) {
echo('No firmware image specified.');
exit(1);
}
if (!imagePath.endsWith(extension)) {
echo(`Firmware image extension is not ${extension}`);
exit(1);
}
if (!test('-f', imagePath)) {
echo('Firmware image does not exist.');
exit(1);
}
}
function getBlhostCmd(pid) {
let blhostPath;
switch (process.platform) {
@@ -55,7 +38,6 @@ function execRetry(command) {
}
const exp = {
checkFirmwareImage,
getBlhostCmd,
execRetry,
}