fix #1411: Set file executable permission after download Java

This commit is contained in:
Glavo 2022-03-18 17:58:20 +08:00 committed by Yuhui Huang
parent 3b1a890423
commit edac522d06

View File

@ -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;
}