Skip to content

Commit

Permalink
Warn when linking to invalid julia binary
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Sep 3, 2024
1 parent b57730a commit c683cab
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/command_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::config_file::{load_mut_config_db, save_config_db};
use crate::global_paths::GlobalPaths;
#[cfg(not(windows))]
use crate::operations::create_symlink;
use crate::utils::is_valid_julia_path;
use crate::versions_file::load_versions_db;
use anyhow::{bail, Context, Result};
use path_absolutize::Absolutize;
Expand Down Expand Up @@ -32,6 +33,10 @@ pub fn run_command_link(
.absolutize()
.with_context(|| format!("Failed to convert path `{}` to absolute path.", file))?;

if !is_valid_julia_path(&absolute_file_path.to_path_buf()) {
eprintln!("WARNING: There is no julia binary at {}. If this was a mistake, run `juliaup remove {}` and try again.", absolute_file_path.to_string_lossy(), channel);
}

config_file.data.installed_channels.insert(
channel.to_string(),
JuliaupConfigChannel::LinkedChannel {
Expand Down

0 comments on commit c683cab

Please sign in to comment.