fix(config): Make print-config not panic without a config (#5001)

This commit is contained in:
Dom Slee
2023-04-14 10:29:21 +10:00
committed by GitHub
parent b44f22e375
commit ce7f984932
9 changed files with 307 additions and 117 deletions
+4 -1
View File
@@ -386,6 +386,7 @@ fn git_status_wsl(context: &Context, conf: &GitStatusConfig) -> Option<String> {
use crate::utils::create_command;
use nix::sys::utsname::uname;
use std::env;
use std::ffi::OsString;
use std::io::ErrorKind;
let starship_exe = conf.windows_starship?;
@@ -454,7 +455,9 @@ fn git_status_wsl(context: &Context, conf: &GitStatusConfig) -> Option<String> {
.map(|mut c| {
c.env(
"STARSHIP_CONFIG",
crate::config::get_config_path().unwrap_or_else(|| "/dev/null".to_string()),
context
.get_config_path_os()
.unwrap_or_else(|| OsString::from("/dev/null")),
)
.env("WSLENV", wslenv)
.args(["module", "git_status", "--path", winpath]);