From 8c3e46019cd3d2fa95b343e4e57ce40c77805339 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 6bd5fac..5c5ea9b 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 1409f44..7266102 100644 --- a/src/run.ts +++ b/src/run.ts @@ -52,8 +52,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()) { @@ -88,7 +87,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');