Skip to content

Commit 1e0cca3

Browse files
committed
fix(bug): remove cleaning dir from abstract tasks
1 parent 4d942bf commit 1e0cca3

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/AbstractJKubeTask.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,7 @@ private File[] gradleFilterFiles(File[] resourceFiles) throws IOException {
221221
return new File[0];
222222
}
223223
final File outDir = kubernetesExtension.getWorkDirectoryOrDefault();
224-
// Clean the working directory before processing to avoid merging with stale files
225-
if (outDir.exists()) {
226-
FileUtils.cleanDirectory(outDir);
227-
} else if (!outDir.mkdirs()) {
224+
if (!outDir.exists() && !outDir.mkdirs()) {
228225
throw new IOException("Cannot create working dir " + outDir);
229226
}
230227
return getFiles(resourceFiles, outDir);

kubernetes-maven-plugin/plugin/src/main/java/org/eclipse/jkube/maven/plugin/mojo/build/AbstractJKubeMojo.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,10 +278,7 @@ private File[] mavenFilterFiles(File[] resourceFiles, File outDir) throws IOExce
278278
if (resourceFiles == null) {
279279
return new File[0];
280280
}
281-
// Clean the working directory before processing to avoid merging with stale files
282-
if (outDir.exists()) {
283-
FileUtils.cleanDirectory(outDir);
284-
} else if (!outDir.mkdirs()) {
281+
if (!outDir.exists() && !outDir.mkdirs()) {
285282
throw new IOException("Cannot create working dir " + outDir);
286283
}
287284
return getFiles(resourceFiles, outDir);

0 commit comments

Comments
 (0)