Matched functionality of the CLI with the Bash predecessor.

This commit is contained in:
2026-04-06 12:00:09 +02:00
parent 483a1c5f13
commit dfa641afd4
13 changed files with 43002 additions and 240 deletions
+8 -3
View File
@@ -7,6 +7,11 @@ export interface PlatformInfo {
archPattern: string;
}
export interface PlatformOverrides {
system?: string;
arch?: string;
}
export const systemPatterns: Record<string, string> = {
linux: 'linux',
darwin: '(darwin|macos|mac|osx)',
@@ -18,9 +23,9 @@ export const archPatterns: Record<string, string> = {
arm64: '(aarch64|arm64)'
};
export function getPlatformInfo(): PlatformInfo {
const system = os.platform();
const arch = os.arch();
export function getPlatformInfo(overrides?: PlatformOverrides): PlatformInfo {
const system = (overrides?.system || os.platform()).toLowerCase();
const arch = (overrides?.arch || os.arch()).toLowerCase();
return {
system,