Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions crates/update/src/cli/self_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,31 @@ impl SelfInstall {
}

eprintln!(
"\
The `spacetime` command has been installed as {cli_bin_file}
Note: we recommend making sure that this executable is in your PATH variable.
"The `spacetime` command has been installed as {}",
cli_bin_file.display()
);
eprintln!();

if cfg!(unix) {
let path_var = std::env::var_os("PATH").unwrap_or_default();
let bin_dir = cli_bin_file.0.parent().unwrap();
if !std::env::split_paths(&path_var).any(|p| p == bin_dir) {
eprintln!(
r#"\
It seems like this directory is not in your `PATH` variable. Please add the
following line to your shell configuration and open a new shell session:

export PATH="{}:$PATH"
"#,
bin_dir.display()
)
}
}

eprintln!(
"\
The install process is complete; check out our quickstart guide to get started!
<https://spacetimedb.com/docs/quick-start>",
cli_bin_file = cli_bin_file.display()
<https://spacetimedb.com/docs/quick-start>"
);

Ok(ExitCode::SUCCESS)
Expand Down
Loading