From 5d9c9b4369cd06f0d801e5c19bfbf20c993d455c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Thu, 28 Nov 2024 21:24:05 +0100 Subject: [PATCH] fix(qseow): Fix broken task visualisation on Windows Fixes #551 --- .gitignore | 2 ++ src/lib/cmd/qseow/vistask.js | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index eb73302..a14d8e0 100644 --- a/.gitignore +++ b/.gitignore @@ -151,3 +151,5 @@ sea-prep.blob .vscode/launch.json certificate.p12 .vscode/launch.json +ctrl-q.exe +.vscode/launch.json diff --git a/src/lib/cmd/qseow/vistask.js b/src/lib/cmd/qseow/vistask.js index a13f0bb..3e8d425 100644 --- a/src/lib/cmd/qseow/vistask.js +++ b/src/lib/cmd/qseow/vistask.js @@ -162,7 +162,7 @@ const prepareFile = async (url) => { logger.verbose(`Paths: ${paths}`); let filePath = path.join(...paths); - logger.verbose(`Serving file ${filePath}`); + logger.verbose(`Joined path ${filePath}`); const pathTraversal = !filePath.startsWith(STATIC_PATH); logger.verbose(`Path traversal: ${pathTraversal}`); @@ -170,6 +170,10 @@ const prepareFile = async (url) => { let exists, streamPath, ext, stream; if (isSea) { + // Change any backslashes to forward slashes, as embedded assets in SEA app are stored with forward slashes + filePath = filePath.replace(/\\/g, '/'); + logger.verbose(`Forward slashes path ${filePath}`); + // Prepend with STATIC_PATH logger.verbose(`url: ${url}`); logger.verbose(`STATIC_PATH: ${STATIC_PATH}`);