Repository: nushell/nushell
File: src/config_files.rs (Rust)

Code before:
        .iter()
        // User autoload directories are evaluated after vendor, which means that
        // the user can override vendor autoload files
        .chain(get_user_autoload_dirs(engine_state).iter())
        .for_each(|autoload_dir| {
            warn!("read_vendor_autoload_files: {}", autoload_dir.display());

            if autoload_dir.exists() {
                // on a second levels files are lexicographically sorted by the string of the filename
                let entries = read_and_sort_directory(autoload_dir);
                if let Ok(entries) = entries {
                    for entry in entries {
                        if !entry.ends_with(".nu") {
                            continue;
                        }
                        let path = autoload_dir.join(entry);
                        warn!("AutoLoading: {path:?}");
                        eval_config_contents(path, engine_state, stack);
                    }
                }
            }
        });
}

fn eval_default_config(engine_state: &mut EngineState, stack: &mut Stack, config_type: ConfigType) {
    warn!("eval_default_config() is_env_config: {config_type:?}");
    eval_source(
        engine_state,
        stack,
        config_type.default().as_bytes(),
        config_type_default_path(config_type),
        PipelineData::empty(),
        false,
    );

    // Merge the environment in case env vars changed in the config
    if let Err(e) = engine_state.merge_env(stack) {
        report_shell_error(engine_state, &e);
    }
}

pub(crate) fn setup_config(
    engine_state: &mut EngineState,
    stack: &mut Stack,
    #[cfg(feature = "plugin")] plugin_file: Option<Spanned<String>>,
    config_file: Option<Spanned<String>>,
    env_file: Option<Spanned<String>>,
    is_login_shell: bool,
) {
    warn!(
        "setup_config() config_file_specified: {:?}, env_file_specified: {:?}, login: {}",

Review comment (suggestion):
```suggestion
    warn!("eval_default_config() config_type: {config_type:?}");
```

Code after:

fn eval_default_config(
    engine_state: &mut EngineState,
    stack: &mut Stack,
    config_kind: ConfigFileKind,
) {
    warn!("eval_default_config() {config_kind:?}");
    eval_source(
        engine_state,
        stack,
        config_kind.default().as_bytes(),
        config_kind.default_path(),
        PipelineData::empty(),
        false,
    );

    // Merge the environment in case env vars changed in the config
    if let Err(e) = engine_state.merge_env(stack) {
        report_shell_error(engine_state, &e);
    }
}

pub(crate) fn setup_config(
    engine_state: &mut EngineState,
    stack: &mut Stack,
    #[cfg(feature = "plugin")] plugin_file: Option<Spanned<String>>,
    config_file: Option<Spanned<String>>,
    env_file: Option<Spanned<String>>,
    is_login_shell: bool,
) {
    warn!(
        "setup_config() config_file_specified: {:?}, env_file_specified: {:?}, login: {}",
        &config_file, &env_file, is_login_shell
    );

    let create_scaffold = nu_path::nu_config_dir().is_some_and(|p| !p.exists());

    let result = catch_unwind(AssertUnwindSafe(|| {
        #[cfg(feature = "plugin")]
        read_plugin_file(engine_state, plugin_file);

        read_config_file(
            engine_state,
            stack,
            env_file,
            ConfigFileKind::Env,
            create_scaffold,
        );
        read_config_file(
            engine_state,
            stack,