mirror of
https://github.com/nushell/nushell
synced 2025-01-13 05:38:57 +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 chrono::Local;
|
||||||
use nu_engine::command_prelude::*;
|
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;
|
use std::io::Write;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -51,7 +51,7 @@ impl Command for ConfigReset {
|
||||||
if !only_env {
|
if !only_env {
|
||||||
let mut nu_config = config_path.clone();
|
let mut nu_config = config_path.clone();
|
||||||
nu_config.push("config.nu");
|
nu_config.push("config.nu");
|
||||||
let config_file = get_default_config();
|
let config_file = get_scaffold_config();
|
||||||
if !no_backup {
|
if !no_backup {
|
||||||
let mut backup_path = config_path.clone();
|
let mut backup_path = config_path.clone();
|
||||||
backup_path.push(format!(
|
backup_path.push(format!(
|
||||||
|
@ -77,7 +77,7 @@ impl Command for ConfigReset {
|
||||||
if !only_nu {
|
if !only_nu {
|
||||||
let mut env_config = config_path.clone();
|
let mut env_config = config_path.clone();
|
||||||
env_config.push("env.nu");
|
env_config.push("env.nu");
|
||||||
let config_file = get_default_env();
|
let config_file = get_scaffold_env();
|
||||||
if !no_backup {
|
if !no_backup {
|
||||||
let mut backup_path = config_path.clone();
|
let mut backup_path = config_path.clone();
|
||||||
backup_path.push(format!("oldenv-{}.nu", Local::now().format("%F-%H-%M-%S"),));
|
backup_path.push(format!("oldenv-{}.nu", Local::now().format("%F-%H-%M-%S"),));
|
||||||
|
|
Loading…
Reference in a new issue