Fix missing indicator for successful install (#93)

* Add successful install message

* No extra newline

* Use new wording
This commit is contained in:
Ana Hobden 2022-12-05 12:21:11 -08:00 committed by GitHub
parent 32dcfe73e7
commit ec0071d28f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,6 +12,7 @@ use crate::{
}; };
use clap::{ArgAction, Parser}; use clap::{ArgAction, Parser};
use eyre::{eyre, WrapErr}; use eyre::{eyre, WrapErr};
use owo_colors::OwoColorize;
/// Execute an install (possibly using an existing plan) /// Execute an install (possibly using an existing plan)
/// ///
@ -139,6 +140,20 @@ impl CommandExecute for Install {
} }
} }
println!(
"\
{success}\n\
To get started using Nix, open a new shell or run `{shell_reminder}`\n\
",
success = "Nix was installed successfully!".green().bold(),
shell_reminder = match std::env::var("SHELL") {
Ok(val) if val.contains("fish") =>
". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.fish".bold(),
Ok(_) | Err(_) =>
". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh".bold(),
},
);
Ok(ExitCode::SUCCESS) Ok(ExitCode::SUCCESS)
} }
} }