Skip to content

Commit

Permalink
Fixup the profile paths in the post-install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Nov 27, 2023
1 parent 0ff7364 commit 3063635
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/cli/subcommand/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ use std::{
};

use crate::{
action::ActionState,
action::{
common::configure_shell_profile::PROFILE_NIX_FILE_FISH,
common::configure_shell_profile::PROFILE_NIX_FILE_SHELL, ActionState,
},
cli::{
ensure_root,
interaction::{self, PromptChoice},
Expand Down Expand Up @@ -312,17 +315,21 @@ impl CommandExecute for Install {
}
},
Ok(_) => {
let load_fish = format!(". {}", PROFILE_NIX_FILE_FISH);
let load_shell = format!(". {}", PROFILE_NIX_FILE_SHELL);
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(val) if val.contains("fish") => {
load_fish.bold()
},
Ok(_) | Err(_) => {
load_shell.bold()
},
},
);
},
Expand Down

0 comments on commit 3063635

Please sign in to comment.