From b677d438697772ce7be52cec8a5f766dd3af8d51 Mon Sep 17 00:00:00 2001 From: Artur Stolear Date: Sat, 8 Feb 2020 10:07:21 +0200 Subject: [PATCH] fix github version of isValidInputFile --- src/agent/github/build-agent.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/agent/github/build-agent.ts b/src/agent/github/build-agent.ts index 2291c17..b8f3528 100644 --- a/src/agent/github/build-agent.ts +++ b/src/agent/github/build-agent.ts @@ -123,7 +123,11 @@ class BuildAgent implements IBuildAgent { } public isValidInputFile(input: string, file: string): boolean { - const pathValue = path.resolve(this.getInput(input) || ""); + return this.filePathSupplied(input) && this.fileExists(file); + } + + public filePathSupplied(file: string): boolean { + const pathValue = path.resolve(this.getInput(file) || ""); const repoRoot = this.getSourceDir(); return pathValue !== repoRoot; }