Skip to content

Commit

Permalink
Phrasing and comments
Browse files Browse the repository at this point in the history
"from" makes more sense to me as the error message seems to be attempting to convey where `julialauncher` got the missing/invalid channel from.
  • Loading branch information
christiangnrd committed Aug 21, 2024
1 parent 03c12a4 commit 6d3bc38
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/bin/julialauncher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,16 @@ fn get_julia_path_from_channel(
}.into(),
JuliaupChannelSource::EnvVar=> {
if is_valid_channel(versions_db, &channel.to_string()) {
UserError { msg: format!("`{}` for environment variable JULIAUP_CHANNEL is not installed. Please run `juliaup add {}` to install channel or version.", channel, channel) }
UserError { msg: format!("`{}` from environment variable JULIAUP_CHANNEL is not installed. Please run `juliaup add {}` to install channel or version.", channel, channel) }
} else {
UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` in environment variable JULIAUP_CHANNEL. Please run `juliaup list` to get a list of valid channels and versions.", channel) }
UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` from environment variable JULIAUP_CHANNEL. Please run `juliaup list` to get a list of valid channels and versions.", channel) }
}
}.into(),
JuliaupChannelSource::Override=> {
if is_valid_channel(versions_db, &channel.to_string()) {
UserError { msg: format!("`{}` for directory override is not installed. Please run `juliaup add {}` to install channel or version.", channel, channel) }
UserError { msg: format!("`{}` from directory override is not installed. Please run `juliaup add {}` to install channel or version.", channel, channel) }
} else {
UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` in directory override. Please run `juliaup list` to get a list of valid channels and versions.", channel) }
UserError { msg: format!("ERROR: Invalid Juliaup channel `{}` from directory override. Please run `juliaup list` to get a list of valid channels and versions.", channel) }
}
}.into(),
JuliaupChannelSource::Default => anyhow!("The Juliaup configuration is in an inconsistent state, the currently configured default channel `{}` is not installed.", channel)
Expand Down
1 change: 1 addition & 0 deletions src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ fn compatible_nightly_channels() -> Result<Vec<String>> {
}

// considers the nightly channels as system channels
// XXX: does not account for PR channels
pub fn is_valid_channel(versions_db: &JuliaupVersionDB, channel: &String) -> bool {
let regular = versions_db.available_channels.contains_key(channel);

Expand Down
2 changes: 1 addition & 1 deletion tests/channel_selection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ fn channel_selection() {
.assert()
.failure()
.stderr(
"ERROR: Invalid Juliaup channel `1.7.4` in environment variable JULIAUP_CHANNEL. Please run `juliaup list` to get a list of valid channels and versions.\n",
"ERROR: Invalid Juliaup channel `1.7.4` from environment variable JULIAUP_CHANNEL. Please run `juliaup list` to get a list of valid channels and versions.\n",
);

Command::cargo_bin("julia")
Expand Down

0 comments on commit 6d3bc38

Please sign in to comment.