Skip to content

Commit

Permalink
Only use -H:Path validation in non-bundle mode
Browse files Browse the repository at this point in the history
When a bundle gets applied, the -H:Path value is purely virtual before
it gets redirected to imagePathOutputDir. Validating the virtual value
makes no sense (and causes errors if the path does not exist anymore)
  • Loading branch information
olpaw committed Jan 15, 2024
1 parent 9761497 commit 888a494
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1225,13 +1225,15 @@ private int completeImageBuild() {
if (!imageNamePathParent.isAbsolute()) {
imageNamePathParent = imagePath.resolve(imageNamePathParent);
}
if (!Files.isDirectory(imageNamePathParent)) {
throw NativeImage.showError("Writing image to non-existent directory " + imageNamePathParent + " is not allowed. " +
"Create the missing directory if you want the image to be written to that location.");
}
if (!Files.isWritable(imageNamePathParent)) {
throw NativeImage.showError("Writing image to directory without write access " + imageNamePathParent + " is not possible. " +
"Ensure the directory has write access or specify image path with write access.");
if (!useBundle()) {
if (!Files.isDirectory(imageNamePathParent)) {
throw NativeImage.showError("Writing image to non-existent directory " + imageNamePathParent + " is not allowed. " +
"Create the missing directory if you want the image to be written to that location.");
}
if (!Files.isWritable(imageNamePathParent)) {
throw NativeImage.showError("Writing image to directory without write access " + imageNamePathParent + " is not possible. " +
"Ensure the directory has write access or specify image path with write access.");
}
}
imagePath = imageNamePathParent;
/* Update arguments passed to builder */
Expand Down

0 comments on commit 888a494

Please sign in to comment.