mirror of
https://github.com/github/codeql.git
synced 2025-12-21 11:16:30 +01:00
Kotlin: Don't fail if a file already exists in the source archive
This commit is contained in:
@@ -222,7 +222,11 @@ fun doFile(invocationTrapFile: String, checkTrapIdentical: Boolean, logger: Logg
|
||||
val dest = Paths.get("$srcDir/${declaration.path}")
|
||||
val destDir = dest.getParent()
|
||||
Files.createDirectories(destDir)
|
||||
Files.copy(Paths.get(declaration.path), dest)
|
||||
val srcTmpFile = File.createTempFile(dest.getFileName().toString() + ".", ".src.tmp", destDir.toFile())
|
||||
val srcTmpOS = FileOutputStream(srcTmpFile)
|
||||
Files.copy(Paths.get(declaration.path), srcTmpOS)
|
||||
srcTmpOS.close()
|
||||
srcTmpFile.renameTo(dest.toFile())
|
||||
|
||||
val trapFile = File("$trapDir/$filePath.trap")
|
||||
val trapFileDir = trapFile.getParentFile()
|
||||
|
||||
Reference in New Issue
Block a user