Skip to content

Commit b0271fa

Browse files
justin39connor4312
andauthored
Fix --commit-id flag for code serve-web (microsoft#258904)
* Fix --commit-id flag for code serve-web Fixes a bug where passing --commit-id during `code serve-web` would prevent serve-web from downloading a new version of the client at all. * Update cli/src/commands/serve_web.rs --------- Co-authored-by: Connor Peet <[email protected]>
1 parent 1297e26 commit b0271fa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/src/commands/serve_web.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ pub async fn serve_web(ctx: CommandContext, mut args: ServeWebArgs) -> Result<i3
9191
if args.commit_id.is_none() {
9292
cm.clone()
9393
.start_update_checker(Duration::from_secs(update_check_interval));
94+
} else {
95+
// If a commit was provided, invoke get_latest_release() once to ensure we're using that exact version;
96+
// get_latest_release() will short-circuit to args.commit_id.
97+
if let Err(e) = cm.get_latest_release().await {
98+
warning!(cm.log, "error getting latest version: {}", e);
99+
}
94100
}
95101

96102
let key = get_server_key_half(&ctx.paths);

0 commit comments

Comments
 (0)