From 158a9adf221a43a6b3378e605c46f5e16d395b62 Mon Sep 17 00:00:00 2001 From: Chris Huseman Date: Tue, 13 Aug 2019 10:44:57 -0500 Subject: [PATCH 1/2] Make sure configFilePath as supplied by the user --- src/GitVersionTfsTask/GitVersion.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GitVersionTfsTask/GitVersion.ts b/src/GitVersionTfsTask/GitVersion.ts index 91a2975716..2397446f39 100644 --- a/src/GitVersionTfsTask/GitVersion.ts +++ b/src/GitVersionTfsTask/GitVersion.ts @@ -7,6 +7,7 @@ export class GitVersionTask { execOptions: tr.IExecOptions; preferBundledVersion: boolean; + configFilePathSupplied: boolean; configFilePath: string; updateAssemblyInfo: boolean; @@ -21,6 +22,7 @@ export class GitVersionTask { constructor() { this.preferBundledVersion = tl.getBoolInput('preferBundledVersion') || true; + this.configFilePathSupplied = tl.filePathSupplied('configFilePath'); this.configFilePath = tl.getPathInput('configFilePath'); this.updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo'); @@ -58,7 +60,7 @@ export class GitVersionTask { "buildserver", "/nofetch"]); - if (this.configFilePath) { + if (this.configFilePathSupplied && this.configFilePath) { exe.arg(["/config", this.configFilePath]); } From 4df542ab9ab5b6abe9db435ae299a8deffed0079 Mon Sep 17 00:00:00 2001 From: Chris Huseman Date: Tue, 13 Aug 2019 10:46:05 -0500 Subject: [PATCH 2/2] Check that configFilePath exists (if specified) --- src/GitVersionTfsTask/GitVersion.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitVersionTfsTask/GitVersion.ts b/src/GitVersionTfsTask/GitVersion.ts index 2397446f39..2ebe5d7ae9 100644 --- a/src/GitVersionTfsTask/GitVersion.ts +++ b/src/GitVersionTfsTask/GitVersion.ts @@ -23,7 +23,7 @@ export class GitVersionTask { constructor() { this.preferBundledVersion = tl.getBoolInput('preferBundledVersion') || true; this.configFilePathSupplied = tl.filePathSupplied('configFilePath'); - this.configFilePath = tl.getPathInput('configFilePath'); + this.configFilePath = tl.getPathInput('configFilePath', false, true); this.updateAssemblyInfo = tl.getBoolInput('updateAssemblyInfo'); this.updateAssemblyInfoFilename = tl.getInput('updateAssemblyInfoFilename');