diff --git a/lib/run.js b/lib/run.js index f556b6c..94feb7a 100644 --- a/lib/run.js +++ b/lib/run.js @@ -60,7 +60,7 @@ function getStableHelmVersion() { }); } var walkSync = function (dir, filelist, fileToFind) { - var fs = fs || require('fs'), files = fs.readdirSync(dir); + var files = fs.readdirSync(dir); filelist = filelist || []; files.forEach(function (file) { if (fs.statSync(path.join(dir, file)).isDirectory()) { @@ -95,6 +95,7 @@ function downloadHelm(version) { } const helmpath = findHelm(cachedToolpath); if (!helmpath) { + throw new Error(util.format("Helm executable not found in path ", cachedToolpath)); } fs.chmodSync(helmpath, '777'); return helmpath; diff --git a/src/run.ts b/src/run.ts index a2262f4..f723294 100644 --- a/src/run.ts +++ b/src/run.ts @@ -53,8 +53,7 @@ async function getStableHelmVersion(): Promise { var walkSync = function(dir, filelist, fileToFind) { - var fs = fs || require('fs'), - files = fs.readdirSync(dir); + var files = fs.readdirSync(dir); filelist = filelist || []; files.forEach(function(file) { if (fs.statSync(path.join(dir, file)).isDirectory()) { @@ -89,7 +88,7 @@ async function downloadHelm(version: string): Promise { const helmpath = findHelm(cachedToolpath); if (!helmpath) { - + throw new Error(util.format("Helm executable not found in path ", cachedToolpath)); } fs.chmodSync(helmpath, '777');