Skip to content

Commit

Permalink
Always recreate symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Gautam Korlam committed Jan 25, 2017
1 parent 319f896 commit a53e645
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions buildSrc/src/main/java/com/uber/okbuck/core/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,11 @@ public static String getIfAvailable(Project project, File file) {
}

public static void createLink(File target, File link) {
Path targetPath = target.toPath();
Path linkPath = link.toPath();
Path targetPath = target.toPath().toAbsolutePath();
Path linkPath = link.toPath().toAbsolutePath();
try {
if (!Files.isSameFile(targetPath, linkPath)) {
Files.deleteIfExists(linkPath);
Files.createSymbolicLink(linkPath, targetPath);
}
Files.deleteIfExists(linkPath);
Files.createSymbolicLink(linkPath, targetPath);
} catch (IOException e) {
throw new RuntimeException(e);
}
Expand Down

0 comments on commit a53e645

Please sign in to comment.