mirror of
https://github.com/openai/codex.git
synced 2026-04-24 14:45:27 +00:00
fix
This commit is contained in:
1
codex-rs/Cargo.lock
generated
1
codex-rs/Cargo.lock
generated
@@ -667,6 +667,7 @@ dependencies = [
|
||||
"serde_json",
|
||||
"tokio",
|
||||
"toml 0.9.4",
|
||||
"tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -13,6 +13,8 @@ use codex_cli::login::run_login_with_chatgpt;
|
||||
use codex_cli::login::run_logout;
|
||||
use codex_cli::proto;
|
||||
use codex_common::CliConfigOverrides;
|
||||
use codex_common::updates::check_for_update;
|
||||
use codex_common::updates::get_upgrade_version;
|
||||
#[cfg(not(debug_assertions))]
|
||||
use codex_core::config::Config;
|
||||
#[cfg(not(debug_assertions))]
|
||||
@@ -224,10 +226,6 @@ fn print_completion(cmd: CompletionCommand) {
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
async fn run_update() -> anyhow::Result<()> {
|
||||
use codex_common::updates::check_for_update;
|
||||
use codex_common::updates::get_upgrade_version;
|
||||
use std::process::Command;
|
||||
|
||||
let overrides = ConfigOverrides {
|
||||
model: None,
|
||||
cwd: None,
|
||||
|
||||
@@ -16,6 +16,7 @@ serde = { version = "1", features = ["derive"], optional = true }
|
||||
serde_json = { version = "1", optional = true }
|
||||
tokio = { version = "1", features = ["fs"], optional = true }
|
||||
toml = { version = "0.9", optional = true }
|
||||
tracing = "0.1.41"
|
||||
|
||||
[features]
|
||||
# Separate feature so that `clap` is not a mandatory dependency.
|
||||
|
||||
@@ -6,6 +6,7 @@ use serde::Deserialize;
|
||||
use serde::Serialize;
|
||||
use std::path::Path;
|
||||
use std::path::PathBuf;
|
||||
use tracing::error;
|
||||
|
||||
/// Returns the latest available version string if it is newer than the current
|
||||
/// one, otherwise `None`.
|
||||
@@ -19,9 +20,9 @@ pub fn get_upgrade_version(config: &Config) -> Option<String> {
|
||||
} {
|
||||
// Refresh in the background; callers can use the cached value for this run.
|
||||
tokio::spawn(async move {
|
||||
if let Err(e) = check_for_update(&version_file).await {
|
||||
eprintln!("Failed to update version: {e}");
|
||||
}
|
||||
check_for_update(&version_file)
|
||||
.await
|
||||
.inspect_err(|e| error!("Failed to update version: {e}"))
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user