fix: remote oh-my-zsh env var export issue (#528)
* fix: fix remove oh-my-zsh env export issue
This commit is contained in:
@@ -181,10 +181,17 @@ pub fn run_oh_my_zsh(ctx: &ExecutionContext) -> Result<()> {
|
|||||||
.args([
|
.args([
|
||||||
"-c",
|
"-c",
|
||||||
// ` > /dev/null` is used in case the user's zshrc will have some stdout output.
|
// ` > /dev/null` is used in case the user's zshrc will have some stdout output.
|
||||||
format!("source {} > /dev/null && echo $ZSH", zshrc_path.display()).as_str(),
|
format!(
|
||||||
|
"source {} > /dev/null && export -p | grep ZSH > /dev/null && echo $ZSH",
|
||||||
|
zshrc_path.display()
|
||||||
|
)
|
||||||
|
.as_str(),
|
||||||
])
|
])
|
||||||
.output_checked_utf8()?;
|
.output_checked_utf8()?;
|
||||||
env::set_var("ZSH", output.stdout.trim());
|
let zsh_env = output.stdout.trim();
|
||||||
|
if !zsh_env.is_empty() {
|
||||||
|
env::set_var("ZSH", zsh_env);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let oh_my_zsh = env::var("ZSH")
|
let oh_my_zsh = env::var("ZSH")
|
||||||
|
|||||||
Reference in New Issue
Block a user