Skip to content

Commit 40106e5

Browse files
committed
Merge pull request #315 from JLLeitschuh/fix/deployNotReplacingExistingFile
Replace Existing when copying to tempdir for deploy
2 parents 0e48050 + a48a8ac commit 40106e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/src/main/java/edu/wpi/grip/ui/util/deployment/DeployedInstanceManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.net.URLDecoder;
2828
import java.nio.file.Files;
2929
import java.nio.file.Paths;
30+
import java.nio.file.StandardCopyOption;
3031
import java.util.Optional;
3132
import java.util.function.Supplier;
3233
import java.util.logging.Level;
@@ -68,7 +69,7 @@ public Factory(
6869
try {
6970
final File coreJarInSource = new File(edu.wpi.grip.core.Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath());
7071
final File newJarInTempDir = new File(new File(System.getProperty("java.io.tmpdir")), DEPLOYED_GRIP_FILE_NAME);
71-
Files.copy(coreJarInSource.toPath(), newJarInTempDir.toPath());
72+
Files.copy(coreJarInSource.toPath(), newJarInTempDir.toPath(), StandardCopyOption.REPLACE_EXISTING);
7273
this.coreJAR = newJarInTempDir;
7374
} catch (URISyntaxException e) {
7475
throw new IllegalStateException("Could not find the main class jar file", e);

0 commit comments

Comments
 (0)