added 'add asset' GRM command
added 'add asset' GRM command
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
GitReleaseManagerCloseSettings,
|
||||
GitReleaseManagerOpenSettings,
|
||||
GitReleaseManagerPublishSettings,
|
||||
GitReleaseManagerAddAssetSettings,
|
||||
} from "./models";
|
||||
|
||||
export interface IGitReleaseManagerTool extends IDotnetTool {
|
||||
@@ -21,6 +22,7 @@ export interface IGitReleaseManagerTool extends IDotnetTool {
|
||||
close(settings: GitReleaseManagerCloseSettings): Promise<IExecResult>;
|
||||
open(settings: GitReleaseManagerOpenSettings): Promise<IExecResult>;
|
||||
publish(settings: GitReleaseManagerPublishSettings): Promise<IExecResult>;
|
||||
addAsset(settings: GitReleaseManagerAddAssetSettings): Promise<IExecResult>;
|
||||
}
|
||||
|
||||
@injectable()
|
||||
@@ -67,6 +69,12 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
return this.execute("dotnet-gitreleasemanager", args);
|
||||
}
|
||||
|
||||
public addAsset(settings: GitReleaseManagerAddAssetSettings): Promise<IExecResult> {
|
||||
const args = this.getAddAssetArguments(settings);
|
||||
|
||||
return this.execute("dotnet-gitreleasemanager", args);
|
||||
}
|
||||
|
||||
private getCommonArguments(settings: GitReleaseManagerSettings): string[] {
|
||||
const args: string[] = [];
|
||||
|
||||
@@ -155,6 +163,23 @@ export class GitReleaseManagerTool extends DotnetTool implements IGitReleaseMana
|
||||
return args;
|
||||
}
|
||||
|
||||
private getAddAssetArguments(settings: GitReleaseManagerAddAssetSettings): string[] {
|
||||
const args: string[] = ['addasset', ...this.getCommonArguments(settings)];
|
||||
|
||||
if (settings.tagName) {
|
||||
args.push("--tagName", settings.tagName);
|
||||
}
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user