From fe0ba87f6c1d708803fec43b212a6ed86a7ef728 Mon Sep 17 00:00:00 2001 From: Philipp Erhardt Date: Wed, 1 Apr 2026 11:56:06 +0000 Subject: [PATCH] Use preset path directly if it exists --- xtasks/crates/config/src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xtasks/crates/config/src/main.rs b/xtasks/crates/config/src/main.rs index 85320c1..10f1c3f 100644 --- a/xtasks/crates/config/src/main.rs +++ b/xtasks/crates/config/src/main.rs @@ -75,8 +75,14 @@ fn ask_confirmation(prompt: &str) -> bool { } fn run_load_preset(preset_name: &str, no_confirm: bool, current_dir: &Path) -> Result<(), Error> { - // Load the preset file from the `presets/` directory. - let preset_path = PathBuf::from("presets").join(format!("{preset_name}.toml")); + // Load the file, or get it from the `presets/` directory + let pb = PathBuf::from(preset_name); + let preset_path = if pb.is_file() { + pb + } else { + PathBuf::from("presets").join(format!("{preset_name}.toml")) + }; + let preset = config::load_toml(&preset_path)?; let config_path = current_dir.join(".cargo/config.toml");