Skip to content

Commit

Permalink
Address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
christiangnrd committed Oct 5, 2024
1 parent abe98f7 commit e9fe7e3
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions src/bin/julialauncher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use itertools::Itertools;
use juliaup::config_file::{load_config_db, JuliaupConfig, JuliaupConfigChannel};
use juliaup::global_paths::get_paths;
use juliaup::jsonstructs_versionsdb::JuliaupVersionDB;
#[cfg(not(windows))]
use juliaup::utils::is_valid_julia_path;
use juliaup::versions_file::load_versions_db;
#[cfg(not(windows))]
use nix::{
Expand Down Expand Up @@ -398,19 +396,15 @@ fn run_app() -> Result<i32> {
}

// replace the current process
if is_valid_julia_path(&julia_path) {
std::process::Command::new(julia_path)
.args(&new_args)
.exec();
} else {
panic!(
"Could not launch Julia. Verify that there is a valid Julia binary at \"{}\".",
julia_path.to_string_lossy()
);
}

// this is never reached
Ok(0)
std::process::Command::new(&julia_path)
.args(&new_args)
.exec();

// this is only ever reached if launching Julia fails
panic!(
"Could not launch Julia. Verify that there is a valid Julia binary at \"{}\".",
julia_path.to_string_lossy()
)
}
Ok(ForkResult::Child) => {
// double-fork to prevent zombies
Expand Down

0 comments on commit e9fe7e3

Please sign in to comment.