You've already forked AstralRinth
forked from didirus/AstralRinth
linux jre missing folders (#99)
* linux jre missing folders * linux jre missing folders
This commit is contained in:
@@ -157,9 +157,18 @@ pub async fn get_all_jre() -> Result<Vec<JavaVersion>, JREError> {
|
|||||||
r"/opt/jdks",
|
r"/opt/jdks",
|
||||||
];
|
];
|
||||||
for path in java_paths {
|
for path in java_paths {
|
||||||
jre_paths.insert(PathBuf::from(path).join("jre").join("bin"));
|
let path = PathBuf::from(path);
|
||||||
jre_paths.insert(PathBuf::from(path).join("bin"));
|
jre_paths.insert(PathBuf::from(&path).join("jre").join("bin"));
|
||||||
|
jre_paths.insert(PathBuf::from(&path).join("bin"));
|
||||||
|
if path.is_dir() {
|
||||||
|
for entry in std::fs::read_dir(&path)? {
|
||||||
|
let entry_path = entry?.path();
|
||||||
|
jre_paths.insert(entry_path.join("jre").join("bin"));
|
||||||
|
jre_paths.insert(entry_path.join("bin"));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get JRE versions from potential paths concurrently
|
// Get JRE versions from potential paths concurrently
|
||||||
let j = check_java_at_filepaths(jre_paths)
|
let j = check_java_at_filepaths(jre_paths)
|
||||||
.await?
|
.await?
|
||||||
|
|||||||
Reference in New Issue
Block a user