|
|
@ -5,17 +5,19 @@ import SERVER_PATHS from './SERVER_PATHS'; |
|
|
|
type OSKeyMapToName = Record<string, string>; |
|
|
|
type OSKeyMapToName = Record<string, string>; |
|
|
|
|
|
|
|
|
|
|
|
const osList: string[] = execSync( |
|
|
|
const osList: string[] = execSync( |
|
|
|
`${SERVER_PATHS.usr.sbin['striker-parse-os-list'].self} | ${SERVER_PATHS.usr.bin['sed'].self} -E 's/^.*name="os_list_([^"]+).*CDATA[[]([^]]+).*$/\\1,\\2/'`, |
|
|
|
SERVER_PATHS.usr.sbin['striker-parse-os-list'].self, |
|
|
|
{ |
|
|
|
{ |
|
|
|
encoding: 'utf-8', |
|
|
|
encoding: 'utf-8', |
|
|
|
timeout: 10000, |
|
|
|
timeout: 10000, |
|
|
|
}, |
|
|
|
}, |
|
|
|
).split('\n'); |
|
|
|
) |
|
|
|
|
|
|
|
.trim() |
|
|
|
osList.pop(); |
|
|
|
.split('\n'); |
|
|
|
|
|
|
|
|
|
|
|
const osKeyMapToName: OSKeyMapToName = osList.reduce((map, csv) => { |
|
|
|
const osKeyMapToName: OSKeyMapToName = osList.reduce((map, csv) => { |
|
|
|
const [osKey, osName] = csv.split(',', 2); |
|
|
|
const [osKey, osName] = csv |
|
|
|
|
|
|
|
.replace(/^key=([^\s]+),name=['"](.*)['"]$/, '$1,$2') |
|
|
|
|
|
|
|
.split(',', 2); |
|
|
|
|
|
|
|
|
|
|
|
map[osKey] = osName; |
|
|
|
map[osKey] = osName; |
|
|
|
|
|
|
|
|
|
|
|