From 1b7fabd1fded850e00b17bc4ad140e8bc680d4ec Mon Sep 17 00:00:00 2001 From: 132ikl <132@ikl.sh> Date: Sun, 5 Jan 2025 16:18:19 -0500 Subject: [PATCH] Fix config reset to use scaffold config files (#14756) In #14249, `config reset` wasn't updated to use the scaffold config files, so running `config reset` would accidentally reset the user's config to the internal defaults. This PR updates it to use the scaffold files. --- crates/nu-command/src/env/config/config_reset.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/nu-command/src/env/config/config_reset.rs b/crates/nu-command/src/env/config/config_reset.rs index 8cf45d21bc..03c022c3d7 100644 --- a/crates/nu-command/src/env/config/config_reset.rs +++ b/crates/nu-command/src/env/config/config_reset.rs @@ -1,7 +1,7 @@ use chrono::Local; use nu_engine::command_prelude::*; -use nu_utils::{get_default_config, get_default_env}; +use nu_utils::{get_scaffold_config, get_scaffold_env}; use std::io::Write; #[derive(Clone)] @@ -51,7 +51,7 @@ impl Command for ConfigReset { if !only_env { let mut nu_config = config_path.clone(); nu_config.push("config.nu"); - let config_file = get_default_config(); + let config_file = get_scaffold_config(); if !no_backup { let mut backup_path = config_path.clone(); backup_path.push(format!( @@ -77,7 +77,7 @@ impl Command for ConfigReset { if !only_nu { let mut env_config = config_path.clone(); env_config.push("env.nu"); - let config_file = get_default_env(); + let config_file = get_scaffold_env(); if !no_backup { let mut backup_path = config_path.clone(); backup_path.push(format!("oldenv-{}.nu", Local::now().format("%F-%H-%M-%S"),));