Skip to content

Commit 2eb26dc

Browse files
committed
fix: resolve merge conflicts and fix API changes
- Fixed duplicate import of get_cortex_home in login.rs - Updated fabric_home to cortex_home in debug_cmd.rs - Fixed run_logout call to include skip_confirmation parameter - Re-added yes flag to LogoutCommand struct
1 parent 3d4483b commit 2eb26dc

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

cortex-cli/src/debug_cmd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ async fn run_config(args: ConfigArgs) -> Result<()> {
227227
println!("Config Diff (Global vs Local)");
228228
println!("{}", "=".repeat(50));
229229

230-
let global_path = config.fabric_home.join("config.toml");
230+
let global_path = config.cortex_home.join("config.toml");
231231
let local_path = std::env::current_dir()
232232
.ok()
233233
.map(|d| d.join(".cortex/config.toml"));

cortex-cli/src/login.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
//! Login command handlers.
22
3-
use cortex_common::{CliConfigOverrides, get_cortex_home};
3+
use cortex_common::CliConfigOverrides;
44
use cortex_login::{
55
AuthMode, CredentialsStoreMode, SecureAuthData, load_auth_with_fallback, logout,
66
safe_format_key, save_auth_with_fallback,
77
};
88
use std::collections::HashSet;
9-
use std::io::{BufRead, IsTerminal, Read};
9+
use std::io::{IsTerminal, Read};
1010
use std::path::PathBuf;
1111

1212
/// Check for duplicate config override keys and warn the user.
@@ -33,7 +33,7 @@ fn check_duplicate_config_overrides(config_overrides: &CliConfigOverrides) {
3333

3434
/// Get the cortex home directory using unified directory management.
3535
fn get_cortex_home() -> PathBuf {
36-
get_cortex_home().unwrap_or_else(|| {
36+
cortex_common::get_cortex_home().unwrap_or_else(|| {
3737
dirs::home_dir()
3838
.map(|h| h.join(".cortex"))
3939
.unwrap_or_else(|| PathBuf::from(".cortex"))

cortex-cli/src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,11 @@ enum LoginSubcommand {
347347
struct LogoutCommand {
348348
#[clap(skip)]
349349
config_overrides: CliConfigOverrides,
350+
351+
/// Skip confirmation prompt and log out immediately.
352+
/// Useful for scripting and automation.
353+
#[arg(short = 'y', long = "yes")]
354+
yes: bool,
350355
}
351356

352357
/// Completion command.
@@ -575,7 +580,7 @@ async fn main() -> Result<()> {
575580
Ok(())
576581
}
577582
Some(Commands::Logout(logout_cli)) => {
578-
run_logout(logout_cli.config_overrides).await;
583+
run_logout(logout_cli.config_overrides, logout_cli.yes).await;
579584
Ok(())
580585
}
581586
Some(Commands::Mcp(mcp_cli)) => mcp_cli.run().await,

0 commit comments

Comments
 (0)