Skip to content

Commit

Permalink
Fixing bug:
Browse files Browse the repository at this point in the history
  • Loading branch information
issacnitin committed May 27, 2020
1 parent f1819f2 commit d955d52
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Tasks/DotNetCoreCLIV2/Common/utility.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as tl from "azure-pipelines-task-lib/task";

export function getProjectFiles(projectPattern: string[], cwd: string): string[] {
export function getProjectFiles(projectPattern: string[], cwd: string|null = null): string[] {
if (projectPattern.length == 0) {
return [""];
}
var projectFiles: string[] = tl.findMatch(tl.getVariable("System.DefaultWorkingDirectory") || cwd, projectPattern);
var projectFiles: string[] = tl.findMatch(cwd || tl.getVariable("System.DefaultWorkingDirectory"), projectPattern);

if (!projectFiles || !projectFiles.length) {
return [];
Expand Down
4 changes: 2 additions & 2 deletions Tasks/DotNetCoreCLIV2/restorecommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export async function run(): Promise<void> {

try {
const projectSearch = tl.getDelimitedInput('projects', '\n', false);

const workingDirectory = tl.getPathInput("workingDirectory", false);
// if no projectSearch strings are given, use "" to operate on the current directory
const projectFiles = utility.getProjectFiles(projectSearch);
const projectFiles = utility.getProjectFiles(projectSearch, workingDirectory);

if (projectFiles.length === 0) {
tl.setResult(tl.TaskResult.Failed, tl.loc('Info_NoFilesMatchedTheSearchPattern'));
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreCLIV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 169,
"Patch": 3
"Patch": 5
},
"minimumAgentVersion": "2.115.0",
"instanceNameFormat": "dotnet $(command)",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DotNetCoreCLIV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"version": {
"Major": 2,
"Minor": 169,
"Patch": 3
"Patch": 5
},
"minimumAgentVersion": "2.115.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down

0 comments on commit d955d52

Please sign in to comment.