Skip to content

Commit f296347

Browse files
author
jantje
committed
#709 implemented differently
1 parent adadd00 commit f296347

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

io.sloeber.core/src/io/sloeber/core/managers/Manager.java

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -661,10 +661,8 @@ public static IStatus extract(ArchiveInputStream in, File destFolder, int stripP
661661
if (entry.getKey().exists() && overwrite) {
662662
entry.getKey().delete();
663663
}
664-
// do not make symlinks in windows
665-
if (!Platform.getOS().equals(Platform.OS_WIN32)) {
666-
symlink(entry.getValue(), entry.getKey());
667-
}
664+
665+
symlink(entry.getValue(), entry.getKey());
668666
entry.getKey().setLastModified(symLinksModifiedTimes.get(entry.getKey()).longValue());
669667
}
670668

@@ -677,10 +675,19 @@ public static IStatus extract(ArchiveInputStream in, File destFolder, int stripP
677675

678676
}
679677

680-
private static void symlink(String something, File somewhere) throws IOException, InterruptedException {
681-
Process process = Runtime.getRuntime().exec(new String[] { "ln", "-s", something, somewhere.getAbsolutePath() }, //$NON-NLS-1$ //$NON-NLS-2$
682-
null, somewhere.getParentFile());
683-
process.waitFor();
678+
private static void symlink(String from, File to) throws IOException, InterruptedException {
679+
if (Platform.getOS().equals(Platform.OS_WIN32)) {
680+
// needs special rights only one board seems to fail due to this
681+
// Process process = Runtime.getRuntime().exec(new String[] {
682+
// "mklink", from, to.getAbsolutePath() }, //$NON-NLS-1$
683+
// null, to.getParentFile());
684+
// process.waitFor();
685+
} else {
686+
Process process = Runtime.getRuntime().exec(new String[] { "ln", "-s", from, to.getAbsolutePath() }, //$NON-NLS-1$ //$NON-NLS-2$
687+
null, to.getParentFile());
688+
process.waitFor();
689+
}
690+
684691
}
685692

686693
private static void link(File something, File somewhere) throws IOException, InterruptedException {

0 commit comments

Comments
 (0)