-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathopenAcrBuildLogs.ts
More file actions
22 lines (18 loc) · 1.1 KB
/
openAcrBuildLogs.ts
File metadata and controls
22 lines (18 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.md in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { type Run as AcrRun } from '@azure/arm-containerregistry';
import { nonNullProp, openReadOnlyContent, type IActionContext } from "@microsoft/vscode-azext-utils";
import { localize } from '../../utils/localize';
export interface AcrBuildResults {
name: AcrRun['name'];
runId: AcrRun['runId'];
content: string;
}
export async function openAcrBuildLogs(_context: IActionContext, acrBuildResults: AcrBuildResults): Promise<void> {
if (!acrBuildResults) {
throw new Error(localize('noAcrBuildResults', 'No Azure Container Registry build results to display.'));
}
await openReadOnlyContent({ label: nonNullProp(acrBuildResults, 'name'), fullId: nonNullProp(acrBuildResults, 'runId') }, nonNullProp(acrBuildResults, 'content'), '.log');
}