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

Commit9a80434

Browse files
authored
feat: show update message if one exists (#127)
1 parent128e4b2 commit9a80434

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

‎src/remote.ts‎

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getWorkspaceByOwnerAndName,
88
startWorkspace,
99
getDeploymentSSHConfig,
10+
getTemplateVersion,
1011
}from"coder/site/src/api/api"
1112
import{ProvisionerJobLog,Workspace,WorkspaceAgent}from"coder/site/src/api/typesGenerated"
1213
importEventSourcefrom"eventsource"
@@ -303,12 +304,20 @@ export class Remote {
303304
if(newWorkspace.outdated){
304305
if(!this.storage.workspace?.outdated||!hasShownOutdatedNotification){
305306
hasShownOutdatedNotification=true
306-
vscode.window
307-
.showInformationMessage("A new version of your workspace is available.","Update")
308-
.then((action)=>{
309-
if(action==="Update"){
310-
vscode.commands.executeCommand("coder.workspace.update",newWorkspace)
307+
getTemplate(newWorkspace.template_id)
308+
.then((template)=>{
309+
returngetTemplateVersion(template.active_version_id)
310+
})
311+
.then((version)=>{
312+
letinfoMessage=`A new version of your workspace is available.`
313+
if(version.message){
314+
infoMessage=`A new version of your workspace is available:${version.message}`
311315
}
316+
vscode.window.showInformationMessage(infoMessage,"Update").then((action)=>{
317+
if(action==="Update"){
318+
vscode.commands.executeCommand("coder.workspace.update",newWorkspace)
319+
}
320+
})
312321
})
313322
}
314323
}
@@ -507,7 +516,14 @@ export class Remote {
507516
if(this.mode===vscode.ExtensionMode.Production){
508517
binaryPath=awaitthis.storage.fetchBinary()
509518
}else{
510-
binaryPath=path.join(os.tmpdir(),"coder")
519+
try{
520+
// In development, try to use `/tmp/coder` as the binary path.
521+
// This is useful for debugging with a custom bin!
522+
binaryPath=path.join(os.tmpdir(),"coder")
523+
awaitfs.stat(binaryPath)
524+
}catch(ex){
525+
binaryPath=awaitthis.storage.fetchBinary()
526+
}
511527
}
512528
if(!binaryPath){
513529
thrownewError("Failed to fetch the Coder binary!")

‎yarn.lock‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ co@3.1.0:
14441444

14451445
"coder@https://github.com/coder/coder#main":
14461446
version "0.0.0"
1447-
resolved "https://github.com/coder/coder#140683813d794081a0c0dbab70ec7eee16c5f5c4"
1447+
resolved "https://github.com/coder/coder#07188b123a6bf925064c3972f581ac7098476839"
14481448

14491449
collapse-white-space@^1.0.2:
14501450
version "1.0.6"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp