Skip to content

Commit 10a6a64

Browse files
authored
Fix separator when getting resultsPath
1 parent ed2452c commit 10a6a64

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

public/electron/scanManager.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,13 @@ const startScan = async (scanDetails, scanEvent) => {
278278
// The true success where the process ran and pages were scanned
279279
if (data.includes('Results directory is at')) {
280280
console.log(data)
281-
const resultsPath = data
282-
.split('Results directory is at ')[1]
283-
.split('/')
284-
.pop()
285-
.split(' ')[0]
281+
const resultsDirLine = data.split('Results directory is at ')[1];
282+
let resultsPath;
283+
if (resultsDirLine) {
284+
// Use platform-specific separator
285+
const sep = process.platform === 'win32' ? '\\' : '/';
286+
resultsPath = resultsDirLine.split(sep).pop().split(' ')[0];
287+
}
286288
const scanId = randomUUID()
287289
scanHistory[scanId] = resultsPath
288290

0 commit comments

Comments
 (0)