Make config default if broken (#482)

* Make config default if broken

* Make config default if broken
This commit is contained in:
JT
2021-12-13 16:16:51 +13:00
committed by GitHub
parent 90ddb23492
commit 2013e9300a
26 changed files with 47 additions and 31 deletions

View File

@ -60,7 +60,7 @@ prints out the list properly."#
let width_param: Option<String> = call.get_flag(engine_state, stack, "width")?;
let color_param: bool = call.has_flag("color");
let separator_param: Option<String> = call.get_flag(engine_state, stack, "separator")?;
let config = stack.get_config()?;
let config = stack.get_config().unwrap_or_default();
let env_str = stack.get_env_var("LS_COLORS");
let use_grid_icons = config.use_grid_icons;

View File

@ -41,7 +41,7 @@ impl Command for Table {
input: PipelineData,
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
let ctrlc = engine_state.ctrlc.clone();
let config = stack.get_config()?;
let config = stack.get_config().unwrap_or_default();
let color_hm = get_color_config(&config);
let term_width = if let Some((Width(w), Height(_h))) = terminal_size::terminal_size() {