-
Notifications
You must be signed in to change notification settings - Fork 854
Use 'aspire logs' command for viewing resource logs in extension #15094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -289,7 +289,11 @@ export class AspireAppHostTreeProvider implements vscode.TreeDataProvider<TreeEl | |
| } | ||
|
|
||
| viewResourceLogs(element: ResourceItem): void { | ||
| this._runResourceCommand(element, 'logs', '--follow'); | ||
| const appHost = this._findAppHostForResource(element); | ||
| if (!appHost) { | ||
| return; | ||
| } | ||
| this._terminalProvider.sendAspireCommandToAspireTerminal(`logs "${element.resource.name}" --apphost "${appHost.appHostPath}" --follow`); | ||
|
||
| } | ||
|
|
||
| async executeResourceCommand(element: ResourceItem): Promise<void> { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sendAspireCommandToAspireTerminalsupports anadditionalArgsarray with platform-specific quoting/escaping, but this code builds a single interpolated command string with manual double-quoting. If resource names/paths ever contain characters like quotes,$, or backticks, this may not behave consistently across shells. Consider switching tosendAspireCommandToAspireTerminal('logs', ..., additionalArgs)(passing the resource name,--apphost, path, and--followas separate args) and optionally making this method async/awaiting the call for clearer error propagation.