Skip to content

Commit

Permalink
Avoid deleting dummy repository files unless needed (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed May 1, 2024
1 parent ee9d068 commit fb4be7a
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,16 @@ private void writeDummyDataIfNeeded(

writeIvyMetadataFile(entry, jarFile, baseDir, metaFile);

Files.deleteIfExists(jarFile);
Files.createFile(jarFile);
if (!Files.isRegularFile(jarFile)) {
FileUtils.delete(jarFile);
Files.createFile(jarFile);
}

final Path sourcesFile = entry.asSources().buildArtifactPath(getRepositoryDirectory().get().getAsFile().toPath());
Files.deleteIfExists(sourcesFile);
Files.createFile(sourcesFile);
if (!Files.isRegularFile(sourcesFile)) {
FileUtils.delete(sourcesFile);
Files.createFile(sourcesFile);
}

writeDummyDependencyDataIfNeeded(entry);
}
Expand Down

0 comments on commit fb4be7a

Please sign in to comment.