use the targetDirectory based on repo root
use the targetDirectory based on repo root
This commit is contained in:
@@ -59,9 +59,9 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
if (settings.milestone) {
|
||||
args.push("--milestone", settings.milestone);
|
||||
}
|
||||
if (settings.targetDirectory) {
|
||||
args.push("--targetDirectory", settings.targetDirectory);
|
||||
}
|
||||
settings.targetDirectory = this.getRepoDir(settings.targetDirectory);
|
||||
|
||||
args.push("--targetDirectory", settings.targetDirectory);
|
||||
|
||||
return args;
|
||||
}
|
||||
@@ -78,9 +78,11 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
if (settings.commit) {
|
||||
args.push("--targetcommitish", settings.commit);
|
||||
}
|
||||
if (settings.targetDirectory) {
|
||||
args.push("--targetDirectory", settings.targetDirectory);
|
||||
}
|
||||
|
||||
settings.targetDirectory = this.getRepoDir(settings.targetDirectory);
|
||||
|
||||
args.push("--targetDirectory", settings.targetDirectory);
|
||||
|
||||
if (settings.inputFileName) {
|
||||
if (this.buildAgent.fileExists(settings.inputFileName)) {
|
||||
args.push("--inputFilePath", settings.inputFileName);
|
||||
@@ -92,9 +94,28 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
args.push("--pre");
|
||||
}
|
||||
if (settings.assets && settings.assets.length > 0) {
|
||||
settings.assets = settings.assets.map(asset => {
|
||||
return path.join(settings.targetDirectory, asset)
|
||||
})
|
||||
|
||||
args.push("--assets", settings.assets.join(","));
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
private getRepoDir(targetPath: string): string {
|
||||
let workDir: string;
|
||||
const srcDir = this.buildAgent.getSourceDir();
|
||||
if (!targetPath) {
|
||||
workDir = srcDir;
|
||||
} else {
|
||||
if (this.buildAgent.directoryExists(targetPath)) {
|
||||
workDir = path.join(srcDir, targetPath);
|
||||
} else {
|
||||
throw new Error("Directory not found at " + targetPath);
|
||||
}
|
||||
}
|
||||
return workDir.replace(/\\/g, "/");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import path = require("path");
|
||||
|
||||
import { injectable, inject } from "inversify";
|
||||
import { IExecResult, IBuildAgent, TYPES } from "../../core/models";
|
||||
import { DotnetTool, IDotnetTool } from "../../core/dotnet-tool";
|
||||
|
||||
Reference in New Issue
Block a user