diff --git a/bshell/main.c b/bshell/main.c index 29ced2c..4e968da 100644 --- a/bshell/main.c +++ b/bshell/main.c @@ -9,6 +9,7 @@ #include #include #include +#include #include enum { @@ -83,6 +84,30 @@ static int bshell( frontend_init(&ctx, flags); enum bshell_status status = BSHELL_SUCCESS; + fx_path *config_base_dir = fx_path_get_system(FX_PATH_CONFIG); + fx_path *profile_path = fx_path_join_list( + 3, + &FX_VALUE_OBJECT(config_base_dir), + &FX_CSTR("bshell"), + &FX_CSTR("profile.bshell")); + fx_path_unref(config_base_dir); + + if (fx_path_is_file(profile_path)) { + status = frontend_eval_file( + &ctx, + NULL, + fx_path_get_cstr(profile_path)); + + if (status != BSHELL_SUCCESS) { + fprintf(stderr, + "%s: cannot evaluate '%s': %s\n", + exec_name, + fx_path_get_cstr(profile_path), + bshell_status_get_description(status)); + } + } + fx_path_unref(profile_path); + size_t nr_input_files = fx_arglist_get_count( opt, FX_COMMAND_INVALID_ID,