Further Cleanup
This commit is contained in:
@@ -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[] }}
|
||||
|
||||
Reference in New Issue
Block a user