feat: add checks for common setup issues (#1799)

* feat: add checks for common setup issues

* colors

* spacing

* clippy
This commit is contained in:
Ellie Huxtable 2024-02-29 18:12:05 +00:00 committed by GitHub
parent 6d62749e19
commit f44928220c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -183,14 +183,39 @@ impl DoctorDump {
}
}
fn checks(info: &DoctorDump) {
println!(); // spacing
//
let zfs_error = "[Filesystem] ZFS is known to have some issues with SQLite. Atuin uses SQLite heavily. If you are having poor performance, there are some workarounds here: https://github.com/atuinsh/atuin/issues/952".bold().red();
let bash_plugin_error = "[Shell] If you are using Bash, Atuin requires that either bash-preexec or ble.sh be installed. Read more here: https://docs.atuin.sh/guide/installation/#bash".bold().red();
// ZFS: https://github.com/atuinsh/atuin/issues/952
if info.system.disks.iter().any(|d| d.filesystem == "zfs") {
println!("{zfs_error}");
}
// Shell
if info.shell.name == "bash"
&& !info
.shell
.plugins
.iter()
.any(|p| p == "blesh" || p == "bash-preexec")
{
println!("{bash_plugin_error}");
}
}
pub fn run(settings: &Settings) -> Result<()> {
println!("{}", "Atuin Doctor".bold());
println!("Checking for diagnostics");
println!("Please include the output below with any bug reports or issues\n");
let dump = DoctorDump::new(settings);
checks(&dump);
let dump = serde_yaml::to_string(&dump)?;
println!("\nPlease include the output below with any bug reports or issues\n");
println!("{dump}");
Ok(())