mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-12 05:16:13 -04:00
fix #1411: Set file executable permission after download Java
This commit is contained in:
parent
3b1a890423
commit
edac522d06
@ -103,12 +103,20 @@ public class JavaDownloadTask extends Task<Void> {
|
||||
} catch (IOException e) {
|
||||
throw new ArtifactMalformedException("File " + entry.getKey() + " is malformed", e);
|
||||
}
|
||||
|
||||
if (file.isExecutable()) {
|
||||
dest.toFile().setExecutable(true);
|
||||
}
|
||||
}));
|
||||
} else if (file.getDownloads().containsKey("raw")) {
|
||||
DownloadInfo download = file.getDownloads().get("raw");
|
||||
FileDownloadTask task = new FileDownloadTask(NetworkUtils.toURL(download.getUrl()), dest.toFile(), new FileDownloadTask.IntegrityCheck("SHA-1", download.getSha1()));
|
||||
task.setName(entry.getKey());
|
||||
if (file.isExecutable()) {
|
||||
dependencies.add(task.thenRunAsync(() -> dest.toFile().setExecutable(true)));
|
||||
} else {
|
||||
dependencies.add(task);
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user