fixup! fixup! Add POSIX shell support
This commit is contained in:
parent
2a890aee27
commit
a7f3c6040c
|
|
@ -38,21 +38,20 @@ impl Init {
|
||||||
let stdout = io::stdout();
|
let stdout = io::stdout();
|
||||||
let mut handle = stdout.lock();
|
let mut handle = stdout.lock();
|
||||||
|
|
||||||
writeln!(handle, "{}", config.z)?;
|
// If any `writeln!` call fails to write to stdout, we assume the user's
|
||||||
|
// computer is on fire and panic.
|
||||||
|
writeln!(handle, "{}", config.z).unwrap();
|
||||||
if !self.no_define_aliases {
|
if !self.no_define_aliases {
|
||||||
writeln!(handle, "{}", config.alias)?;
|
writeln!(handle, "{}", config.alias).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
match self.hook {
|
match self.hook {
|
||||||
Hook::none => (),
|
Hook::none => (),
|
||||||
Hook::prompt => writeln!(handle, "{}", config.hook.prompt)?,
|
Hook::prompt => writeln!(handle, "{}", config.hook.prompt).unwrap(),
|
||||||
Hook::pwd => {
|
Hook::pwd => match config.hook.pwd {
|
||||||
if let Some(pwd_hook) = config.hook.pwd {
|
Some(pwd_hook) => writeln!(handle, "{}", pwd_hook).unwrap(),
|
||||||
writeln!(handle, "{}", pwd_hook)?;
|
None => bail!("PWD hooks are currently unsupported on this shell."),
|
||||||
} else {
|
},
|
||||||
bail!("PWD hooks are currently unsupported on this shell.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue