« get me outta code hell

attempt to fix path issues on windows - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/write/build-modes
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-01-09 21:42:25 -0400
committer(quasar) nebula <qznebula@protonmail.com>2023-01-09 21:42:25 -0400
commit0480e9a6502695fb741fc300db03ef734f38b51c (patch)
treeebd6d24e6da0be0f0d51e4eb0921e044e6cbc7c2 /src/write/build-modes
parenta532f066ffbe0387216c85323fdf81aff36c1d6c (diff)
attempt to fix path issues on windows
Diffstat (limited to 'src/write/build-modes')
-rw-r--r--src/write/build-modes/live-dev-server.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/write/build-modes/live-dev-server.js b/src/write/build-modes/live-dev-server.js
index f322a79b..a8e54247 100644
--- a/src/write/build-modes/live-dev-server.js
+++ b/src/write/build-modes/live-dev-server.js
@@ -151,7 +151,7 @@ export async function go({
 
     if (localFileArea) {
       // Not security tested, man, this is a dev server!!
-      const safePath = path.resolve('/', localFilePath).replace(/^\//, '');
+      const safePath = path.posix.resolve('/', localFilePath).replace(/^\//, '');
 
       let localDirectory;
       if (localFileArea === 'static' || localFileArea === 'util') {
@@ -160,7 +160,7 @@ export async function go({
         localDirectory = mediaPath;
       }
 
-      const filePath = path.resolve(localDirectory, safePath);
+      const filePath = path.resolve(localDirectory, safePath.split('/').join(path.sep));
 
       try {
         await stat(filePath);