« get me outta code hell

create junction symlinks on windows - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2021-12-31 20:17:17 -0400
committer(quasar) nebula <qznebula@protonmail.com>2021-12-31 20:17:17 -0400
commit7710fc578ec94bb9edca551e7d38ab30d8560ecf (patch)
tree8a757b58895001d49f1d8f65c334a87646e5e9b9
parent61ebd2b91809d372253c1005552a9012c519b361 (diff)
create junction symlinks on windows
-rwxr-xr-xsrc/upd8.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/upd8.js b/src/upd8.js
index 6a0ff08..91cc66d 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -2052,7 +2052,13 @@ function writeSymlinks() {
                 throw error;
             }
         }
-        await symlink(path.resolve(directory), file);
+        try {
+            await symlink(path.resolve(directory), file);
+        } catch (error) {
+            if (error.code === 'EPERM') {
+                await symlink(path.resolve(directory), file, 'junction');
+            }
+        }
     }
 }