Further Cleanup

This commit is contained in:
2026-08-18 16:43:40 -04:00
parent 45a99e5fde
commit 7e21c47b0f
92 changed files with 16037 additions and 17662 deletions
+16
View File
@@ -3,6 +3,22 @@
*/
import path from 'path'
/**
* Product argv with the runtime launcher stripped (`bare` → skip 2, else skip 1).
* @returns {string[]}
*/
export function hostArgv() {
if (
typeof globalThis.Bare !== 'undefined' &&
Array.isArray(globalThis.Bare.argv)
) {
const a0 = String(globalThis.Bare.argv[0] || '')
const base = a0.split(/[/\\]/).pop() || ''
return globalThis.Bare.argv.slice(base === 'bare' ? 2 : 1)
}
return globalThis.process?.argv?.slice(2) || []
}
/**
* @param {string[]} argv
* @returns {{ datadir: string|null, rest: string[] }}