Skip to content

Commit

Permalink
CAMEL-21442: camel-jbang export is not working when local-kamelet-dir…
Browse files Browse the repository at this point in the history
… set to current dir
  • Loading branch information
tdiesler committed Jan 24, 2025
1 parent fd6a1d4 commit 05fb6e3
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -572,8 +572,9 @@ protected void copySourceFiles(
boolean web = "html".equals(ext) || "js".equals(ext) || "css".equals(ext) || "jpeg".equals(ext)
|| "jpg".equals(ext) || "png".equals(ext) || "ico".equals(ext);
File srcWeb = new File(srcResourcesDir, "META-INF/resources");
File target = java ? srcJavaDir : camel ? srcCamelResourcesDir : kamelet ? srcKameletsResourcesDir
File targetDir = java ? srcJavaDir : camel ? srcCamelResourcesDir : kamelet ? srcKameletsResourcesDir
: web ? srcWeb : srcResourcesDir;
targetDir.mkdirs();

File source;
if ("kamelet".equals(k) && localKameletDir != null) {
Expand All @@ -584,13 +585,12 @@ protected void copySourceFiles(
}
File out;
if (source.isDirectory()) {
out = target;
out = targetDir;
} else {
out = new File(target, source.getName());
out = new File(targetDir, source.getName());
}
if (!java) {
if (kamelet) {
out.getParentFile().mkdirs();
safeCopy(source, out, true);
} else if (jkube) {
// file should be renamed and moved into src/main/jkube
Expand Down Expand Up @@ -893,7 +893,7 @@ protected void safeCopy(File source, File target, boolean override) throws Excep
}

if (source.isDirectory()) {
// flattern files if they are from a directory
// flatten files if they are from a directory
File[] children = source.listFiles();
if (children != null) {
for (File child : children) {
Expand Down

0 comments on commit 05fb6e3

Please sign in to comment.