mirror of
https://github.com/atuinsh/atuin.git
synced 2025-06-20 09:58:00 +02:00
feat: add checks for common setup issues (#1799)
* feat: add checks for common setup issues * colors * spacing * clippy
This commit is contained in:
parent
6d62749e19
commit
f44928220c
@ -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<()> {
|
pub fn run(settings: &Settings) -> Result<()> {
|
||||||
println!("{}", "Atuin Doctor".bold());
|
println!("{}", "Atuin Doctor".bold());
|
||||||
println!("Checking for diagnostics");
|
println!("Checking for diagnostics");
|
||||||
println!("Please include the output below with any bug reports or issues\n");
|
|
||||||
|
|
||||||
let dump = DoctorDump::new(settings);
|
let dump = DoctorDump::new(settings);
|
||||||
|
|
||||||
|
checks(&dump);
|
||||||
|
|
||||||
let dump = serde_yaml::to_string(&dump)?;
|
let dump = serde_yaml::to_string(&dump)?;
|
||||||
|
|
||||||
|
println!("\nPlease include the output below with any bug reports or issues\n");
|
||||||
println!("{dump}");
|
println!("{dump}");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user