Skip to content

Commit 1b7fabd

Browse files
authored
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.
1 parent 87a562e commit 1b7fabd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/nu-command/src/env/config/config_reset.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use chrono::Local;
22
use nu_engine::command_prelude::*;
33

4-
use nu_utils::{get_default_config, get_default_env};
4+
use nu_utils::{get_scaffold_config, get_scaffold_env};
55
use std::io::Write;
66

77
#[derive(Clone)]
@@ -51,7 +51,7 @@ impl Command for ConfigReset {
5151
if !only_env {
5252
let mut nu_config = config_path.clone();
5353
nu_config.push("config.nu");
54-
let config_file = get_default_config();
54+
let config_file = get_scaffold_config();
5555
if !no_backup {
5656
let mut backup_path = config_path.clone();
5757
backup_path.push(format!(
@@ -77,7 +77,7 @@ impl Command for ConfigReset {
7777
if !only_nu {
7878
let mut env_config = config_path.clone();
7979
env_config.push("env.nu");
80-
let config_file = get_default_env();
80+
let config_file = get_scaffold_env();
8181
if !no_backup {
8282
let mut backup_path = config_path.clone();
8383
backup_path.push(format!("oldenv-{}.nu", Local::now().format("%F-%H-%M-%S"),));

0 commit comments

Comments
 (0)