From 785a9d3ba26c3330446254e38a5fb45276120186 Mon Sep 17 00:00:00 2001 From: Anumita Shenoy Date: Tue, 15 Oct 2019 13:33:32 +0530 Subject: [PATCH] Added exception for helm-path --- lib/run.js | 3 ++- src/run.ts | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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');