From 0924975b4c3db5204d75a0363e4f70ee2f51dde8 Mon Sep 17 00:00:00 2001 From: JT <547158+jntrnr@users.noreply.github.com> Date: Mon, 28 Feb 2022 10:12:08 -0500 Subject: [PATCH] Use default_config.nu by default (#4675) * Use default_config.nu by default * Fix default color --- src/config_files.rs | 11 ++++++++++- src/default_config.nu | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/config_files.rs b/src/config_files.rs index cf2dfb7ba..d0093fca7 100644 --- a/src/config_files.rs +++ b/src/config_files.rs @@ -92,15 +92,24 @@ pub(crate) fn read_config_file( .read_line(&mut answer) .expect("Failed to read user input"); + let config_file = include_str!("default_config.nu"); + match answer.to_lowercase().trim() { "y" | "" => { let mut output = File::create(&config_path).expect("Unable to create file"); - let config_file = include_str!("default_config.nu"); write!(output, "{}", config_file).expect("Unable to write to config file"); println!("Config file created at: {}", config_path.to_string_lossy()); } _ => { println!("Continuing without config file"); + // Just use the contents of "default_config.nu" + eval_source( + engine_state, + stack, + config_file.as_bytes(), + "default_config.nu", + PipelineData::new(Span::new(0, 0)), + ); return; } } diff --git a/src/default_config.nu b/src/default_config.nu index 0fe5ab966..bb1044348 100644 --- a/src/default_config.nu +++ b/src/default_config.nu @@ -138,7 +138,7 @@ let default_theme = { shape_int: purple_bold shape_float: purple_bold shape_range: yellow_bold - shape_internalcall: cyna_bold + shape_internalcall: cyan_bold shape_external: cyan shape_externalarg: green_bold shape_literal: blue