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

feat: show update message if one exists#127

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
kylecarbs merged 1 commit intomainfromupdatemessage
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat: show update message if one exists
  • Loading branch information
@kylecarbs
kylecarbs committedAug 21, 2023
commitd50f7569f7421d6502d6a10c9c8fd11e51c141e9
28 changes: 22 additions & 6 deletionssrc/remote.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ import {
getWorkspaceByOwnerAndName,
startWorkspace,
getDeploymentSSHConfig,
getTemplateVersion,
} from "coder/site/src/api/api"
import { ProvisionerJobLog, Workspace, WorkspaceAgent } from "coder/site/src/api/typesGenerated"
import EventSource from "eventsource"
Expand DownExpand Up@@ -303,12 +304,20 @@ export class Remote {
if (newWorkspace.outdated) {
if (!this.storage.workspace?.outdated || !hasShownOutdatedNotification) {
hasShownOutdatedNotification = true
vscode.window
.showInformationMessage("A new version of your workspace is available.", "Update")
.then((action) => {
if (action === "Update") {
vscode.commands.executeCommand("coder.workspace.update", newWorkspace)
getTemplate(newWorkspace.template_id)
.then((template) => {
return getTemplateVersion(template.active_version_id)
})
.then((version) => {
let infoMessage = `A new version of your workspace is available.`
if (version.message) {
infoMessage = `A new version of your workspace is available: ${version.message}`
}
vscode.window.showInformationMessage(infoMessage, "Update").then((action) => {
if (action === "Update") {
vscode.commands.executeCommand("coder.workspace.update", newWorkspace)
}
})
})
}
}
Expand DownExpand Up@@ -507,7 +516,14 @@ export class Remote {
if (this.mode === vscode.ExtensionMode.Production) {
binaryPath = await this.storage.fetchBinary()
} else {
binaryPath = path.join(os.tmpdir(), "coder")
try {
// In development, try to use `/tmp/coder` as the binary path.
// This is useful for debugging with a custom bin!
binaryPath = path.join(os.tmpdir(), "coder")
await fs.stat(binaryPath)
} catch (ex) {
binaryPath = await this.storage.fetchBinary()
}
}
if (!binaryPath) {
throw new Error("Failed to fetch the Coder binary!")
Expand Down
2 changes: 1 addition & 1 deletionyarn.lock
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1444,7 +1444,7 @@ co@3.1.0:

"coder@https://github.com/coder/coder#main":
version "0.0.0"
resolved "https://github.com/coder/coder#140683813d794081a0c0dbab70ec7eee16c5f5c4"
resolved "https://github.com/coder/coder#07188b123a6bf925064c3972f581ac7098476839"

collapse-white-space@^1.0.2:
version "1.0.6"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp