Skip to content

Commit 69ab90c

Browse files
committed
Update to work with headers (only tested on OS X)
1 parent a6c2a8b commit 69ab90c

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/main/java/edu/wpi/first/wpilib/opencv/installer/Installer.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ private static void install(ArtifactType type) {
195195
break;
196196
case HEADERS:
197197
artifactId = headersName;
198+
v = openCvVersion;
198199
installLocation += platform.getHeadersInstallLocation();
199200
break;
200201
case NATIVES:
@@ -295,11 +296,15 @@ private static void unsafeCopy(Path src, Path dst) {
295296
if (dst.getParent() != null && !Files.exists(dst.getParent())) {
296297
Files.createDirectories(dst.getParent());
297298
}
298-
if (Files.exists(dst)) {
299-
System.out.println(" Destination file already exists, overwriting");
300-
Files.delete(dst);
299+
if (Files.isDirectory(dst)) {
300+
copyAll(src, dst);
301+
} else {
302+
if (Files.exists(dst)) {
303+
System.out.println(" Destination file already exists, overwriting");
304+
Files.delete(dst);
305+
}
306+
Files.copy(src, dst);
301307
}
302-
Files.copy(src, dst);
303308
}
304309
} catch (IOException e) {
305310
throw new RuntimeException((e));

0 commit comments

Comments
 (0)