Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit897002a

Browse files
committed
Fix the open log command
The command was opening the old log path.
1 parent70eb79b commit897002a

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

‎src/commands.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,10 @@ export class Commands {
266266
*/
267267
publicasyncviewLogs():Promise<void>{
268268
if(!this.workspaceLogPath){
269-
vscode.window.showInformationMessage("No logs available.",this.workspaceLogPath||"<unset>")
269+
vscode.window.showInformationMessage(
270+
"No logs available. Make sure to set coder.proxyLogDirectory to get logs.",
271+
this.workspaceLogPath||"<unset>",
272+
)
270273
return
271274
}
272275
consturi=vscode.Uri.file(this.workspaceLogPath)

‎src/remote.ts‎

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,16 @@ export class Remote {
430430
return
431431
}
432432

433+
constlogDir=this.getLogDir(featureSet)
434+
433435
// This ensures the Remote SSH extension resolves the host to execute the
434436
// Coder binary properly.
435437
//
436438
// If we didn't write to the SSH config file, connecting would fail with
437439
// "Host not found".
438440
try{
439441
this.storage.writeToCoderOutputChannel("Updating SSH config...")
440-
awaitthis.updateSSHConfig(workspaceRestClient,parts.label,parts.host,binaryPath,featureSet)
442+
awaitthis.updateSSHConfig(workspaceRestClient,parts.label,parts.host,binaryPath,logDir)
441443
}catch(error){
442444
this.storage.writeToCoderOutputChannel(`Failed to configure SSH:${error}`)
443445
throwerror
@@ -450,7 +452,7 @@ export class Remote {
450452
return
451453
}
452454
disposables.push(this.showNetworkUpdates(pid))
453-
this.commands.workspaceLogPath=path.join(this.storage.getLogPath(),`${pid}.log`)
455+
this.commands.workspaceLogPath=logDir ?path.join(logDir,`${pid}.log`) :undefined
454456
})
455457

456458
// Register the label formatter again because SSH overrides it!
@@ -476,34 +478,33 @@ export class Remote {
476478
}
477479

478480
/**
479-
* Format's the --log-dir argument for the ProxyCommand
481+
* Return the --log-dir argument value for the ProxyCommand. It may be an
482+
* empty string if the setting is not set or the cli does not support it.
480483
*/
481-
privateasyncformatLogArg(featureSet:FeatureSet):Promise<string>{
484+
privategetLogDir(featureSet:FeatureSet):string{
482485
if(!featureSet.proxyLogDirectory){
483486
return""
484487
}
485-
486488
// If the proxyLogDirectory is not set in the extension settings we don't send one.
487-
// Question for Asher: How do VSCode extension settings behave in terms of semver for the extension?
488-
constlogDir=expandPath(String(vscode.workspace.getConfiguration().get("coder.proxyLogDirectory")??"").trim())
489+
returnexpandPath(String(vscode.workspace.getConfiguration().get("coder.proxyLogDirectory")??"").trim())
490+
}
491+
492+
/**
493+
* Formats the --log-dir argument for the ProxyCommand after making sure it
494+
* has been created.
495+
*/
496+
privateasyncformatLogArg(logDir:string):Promise<string>{
489497
if(!logDir){
490498
return""
491499
}
492-
493500
awaitfs.mkdir(logDir,{recursive:true})
494501
this.storage.writeToCoderOutputChannel(`SSH proxy diagnostics are being written to${logDir}`)
495502
return` --log-dir${escape(logDir)}`
496503
}
497504

498505
// updateSSHConfig updates the SSH configuration with a wildcard that handles
499506
// all Coder entries.
500-
privateasyncupdateSSHConfig(
501-
restClient:Api,
502-
label:string,
503-
hostName:string,
504-
binaryPath:string,
505-
featureSet:FeatureSet,
506-
){
507+
privateasyncupdateSSHConfig(restClient:Api,label:string,hostName:string,binaryPath:string,logDir:string){
507508
letdeploymentSSHConfig={}
508509
try{
509510
constdeploymentConfig=awaitrestClient.getDeploymentSSHConfig()
@@ -585,7 +586,7 @@ export class Remote {
585586
Host:label ?`${AuthorityPrefix}.${label}--*` :`${AuthorityPrefix}--*`,
586587
ProxyCommand:`${escape(binaryPath)}${headerArg} vscodessh --network-info-dir${escape(
587588
this.storage.getNetworkInfoPath(),
588-
)}${awaitthis.formatLogArg(featureSet)} --session-token-file${escape(this.storage.getSessionTokenPath(label))} --url-file${escape(
589+
)}${awaitthis.formatLogArg(logDir)} --session-token-file${escape(this.storage.getSessionTokenPath(label))} --url-file${escape(
589590
this.storage.getUrlPath(label),
590591
)} %h`,
591592
ConnectTimeout:"0",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp