Skip to content

Commit d9e80e8

Browse files
committed
Update packages, improve zip install
1 parent 6a7741c commit d9e80e8

18 files changed

+681
-544
lines changed

Cargo.lock

Lines changed: 483 additions & 386 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,51 @@ repository = "https://github.com/octylFractal/java-preloader-reloadeder"
1111
edition = "2021"
1212

1313
[dependencies]
14-
error-stack = "0.5.0"
14+
error-stack = "0.6.0"
1515
digest = "0.10.7"
16-
sha2 = "0.10.8"
16+
sha2 = "0.10.9"
1717
directories = "6.0.0"
1818
tracing = "0.1.41"
19-
toml = "0.8.20"
20-
toml_edit = "0.22.24"
19+
toml = "0.9.6"
20+
toml_edit = "0.23.5"
2121
itertools = "0.14.0"
22-
thiserror = "2.0.12"
23-
console = "0.15.11"
24-
indicatif = "0.17.11"
22+
thiserror = "2.0.16"
23+
console = "0.16.1"
24+
indicatif = "0.18.0"
2525
hex = "0.4.3"
26-
tempfile = "3.19.1"
26+
tempfile = "3.22.0"
2727
tar = "0.4.44"
28-
flate2 = "1.1.0"
29-
zip = "2.5.0"
28+
flate2 = "1.1.2"
29+
zip = "5.1.1"
3030
enum_dispatch = "0.3.13"
3131

3232
[dependencies.url]
33-
version = "2.5.4"
33+
version = "2.5.7"
3434
features = ["serde"]
3535

3636
[dependencies.ureq]
37-
version = "3.0.10"
37+
version = "3.1.2"
3838
features = ["json"]
3939

4040
[dependencies.owo-colors]
41-
version = "4.2.0"
41+
version = "4.2.2"
4242
features = ["supports-colors"]
4343

4444
[dependencies.derive_more]
4545
version = "2.0.1"
4646
features = ["full"]
4747

4848
[dependencies.clap]
49-
version = "4.5.34"
49+
version = "4.5.47"
5050
features = ["derive"]
5151

5252
[dependencies.serde]
53-
version = "1.0.219"
53+
version = "1.0.225"
5454
features = ["derive"]
5555

5656
[dependencies.tracing-subscriber]
57-
version = "0.3.19"
57+
# Force 0.3.19 because of https://github.com/tokio-rs/tracing/issues/3369
58+
version = "=0.3.19"
5859
features = ["env-filter"]
5960

6061
# Optimize dependencies in dev

src/command/current.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ impl JpreCommand for Current {
1818
}
1919
let link_target = std::fs::read_link(&path)
2020
.change_context(JpreError::Unexpected)
21-
.attach_printable_lazy(|| format!("Failed to read link target of {:?}", path))?;
21+
.attach_with(|| format!("Failed to read link target of {:?}", path))?;
2222
let full_version = JDK_MANAGER
2323
.get_full_version_from_path(&link_target)
2424
.change_context(JpreError::Unexpected)
25-
.attach_printable_lazy(|| format!("Failed to get full version of {:?}", link_target))?;
25+
.attach_with(|| format!("Failed to get full version of {:?}", link_target))?;
2626

2727
println!(
2828
"{}",

src/command/java_home.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ impl JpreCommand for JavaHome {
2929
Ok(())
3030
})()
3131
.change_context(JpreError::Unexpected)
32-
.attach_printable("Failed to write Java home path to stderr")?;
32+
.attach("Failed to write Java home path to stderr")?;
3333

3434
Ok(())
3535
}

src/command/list_distributions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl JpreCommand for ListDistributions {
1919
FOOJAY_API
2020
.list_distributions()
2121
.change_context(JpreError::Unexpected)
22-
.attach_printable("Failed to list distributions")?,
22+
.attach("Failed to list distributions")?,
2323
);
2424
distributions.sort();
2525
for distribution in distributions {

src/command/list_installed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl JpreCommand for ListInstalled {
1515
let mut installed = JDK_MANAGER
1616
.get_installed_jdks()
1717
.change_context(JpreError::Unexpected)
18-
.attach_printable("Failed to get installed JDKs")?;
18+
.attach("Failed to get installed JDKs")?;
1919

2020
installed.sort();
2121

@@ -24,7 +24,7 @@ impl JpreCommand for ListInstalled {
2424
let full = JDK_MANAGER
2525
.get_full_version(&jdk)
2626
.change_context(JpreError::Unexpected)
27-
.attach_printable_lazy(|| format!("Failed to get full version for JDK {}", jdk))?;
27+
.attach_with(|| format!("Failed to get full version for JDK {}", jdk))?;
2828
println!(
2929
"- {} (full: {})",
3030
jdk.if_supports_color(Stream::Stdout, |s| s.color(jdk_color())),

src/command/list_versions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ impl JpreCommand for ListVersions {
3838
{
3939
return Err(err
4040
.change_context(JpreError::UserError)
41-
.attach(UserMessage {
41+
.attach_opaque(UserMessage {
4242
message: format!("Distribution '{}' not found", distribution),
4343
}));
4444
}
4545
Err(err) => {
4646
return Err(err
4747
.change_context(JpreError::Unexpected)
48-
.attach_printable("Failed to list versions"))
48+
.attach("Failed to list versions"))
4949
}
5050
};
5151
major_versions.sort();

src/command/remove_jdk.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ impl JpreCommand for RemoveJdk {
1919
let path = JDK_MANAGER
2020
.get_jdk_path(&context.config, &self.jdk)
2121
.change_context(JpreError::Unexpected)
22-
.attach_printable_lazy(|| format!("Failed to get path for JDK {}", self.jdk))?;
22+
.attach_with(|| format!("Failed to get path for JDK {}", self.jdk))?;
2323
std::fs::remove_dir_all(&path)
2424
.change_context(JpreError::Unexpected)
25-
.attach_printable_lazy(|| format!("Failed to remove JDK at {}", path.display()))?;
25+
.attach_with(|| format!("Failed to remove JDK at {}", path.display()))?;
2626
eprintln!(
2727
"Removed JDK {}",
2828
self.jdk

src/command/set_default.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl JpreCommand for SetDefault {
3737
JDK_MANAGER
3838
.get_jdk_path(&context.config, &self.jdk)
3939
.change_context(JpreError::Unexpected)
40-
.attach_printable_lazy(|| format!("Failed to get path for JDK {}", self.jdk))?;
40+
.attach_with(|| format!("Failed to get path for JDK {}", self.jdk))?;
4141

4242
context.config.edit_config(|doc| {
4343
doc["default_jdk"] = toml_edit::value(self.jdk.to_string());

src/command/set_distributions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ impl JpreCommand for SetDistributions {
3030
let distributions = FOOJAY_API
3131
.list_distributions()
3232
.change_context(JpreError::Unexpected)
33-
.attach_printable("Failed to list distributions")?;
33+
.attach("Failed to list distributions")?;
3434
let all_names = distributions
3535
.iter()
3636
.flat_map(|i| &i.synonyms)
@@ -45,10 +45,10 @@ impl JpreCommand for SetDistributions {
4545
if !missing_names.is_empty() {
4646
missing_names.sort();
4747
return Err(Report::new(JpreError::UserError)
48-
.attach(UserMessage {
48+
.attach_opaque(UserMessage {
4949
message: format!("Distribution(s) '{}' not found", missing_names.join(", ")),
5050
})
51-
.attach(UserMessage {
51+
.attach_opaque(UserMessage {
5252
message: format!(
5353
"Available distributions: {}",
5454
distributions.into_iter().map(|i| i.name).join(", ")

0 commit comments

Comments
 (0)