codeburn/app/scripts/windows-installer-paths.mjs
2026-08-13 19:47:31 +05:30

8 lines
330 B
JavaScript

import { posix, win32 } from 'node:path'
import { fileURLToPath } from 'node:url'
export function rootFromModuleUrl(moduleUrl, windows = process.platform === 'win32') {
const path = windows ? win32 : posix
const scriptPath = fileURLToPath(moduleUrl, { windows })
return path.resolve(path.dirname(scriptPath), '..', '..')
}