'use strict'; const path = require('path'); /** * Under Wine, the folder picker often returns a Unix absolute path (/home/...). * Windows Node does not resolve that to the WoW install; map to Wine's Z: drive * (Z: == / on typical Wine prefixes). */ function normalizeWinGameDir(gameDir) { if (process.platform !== 'win32') return String(gameDir || '').trim(); let s = String(gameDir || '').trim(); if (!s) return s; s = s.replace(/\//g, path.win32.sep); if (s.startsWith('\\\\')) return path.normalize(s); if (/^[A-Za-z]:/.test(s)) return path.normalize(s); if (s.startsWith(path.win32.sep)) return path.win32.normalize(`Z:${s}`); return path.normalize(s); } module.exports = { normalizeWinGameDir };