mirror of
https://github.com/nushell/nushell
synced 2025-01-12 21:29:07 +00:00
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.
This commit is contained in:
parent
87a562e24b
commit
1b7fabd1fd
1 changed files with 3 additions and 3 deletions
|
@ -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"),));
|
||||
|
|
Loading…
Reference in a new issue