MCPcopy Create free account
hub / github.com/Snapchat/Valdi / getDebianArchitecture

Function getDebianArchitecture

npm_modules/cli/src/setup/linuxSetup.ts:23–51  ·  view source on GitHub ↗

* Maps Node.js architecture names to Debian package architecture names. * @returns Debian package architecture string (e.g., 'amd64', 'arm64', 'armhf')

()

Source from the content-addressed store, hash-verified

21 * @returns Debian package architecture string (e.g., 'amd64', 'arm64', 'armhf')
22 */
23function getDebianArchitecture(): string {
24 const nodeArch = os.arch();
25
26 // Map Node.js arch names to Debian package arch names
27 switch (nodeArch) {
28 case 'x64': {
29 return 'amd64';
30 }
31 case 'arm64': {
32 return 'arm64';
33 }
34 case 'arm': {
35 return 'armhf';
36 }
37 case 'ia32': {
38 return 'i386';
39 }
40 default: {
41 // Fallback to amd64 for unknown architectures
42 console.log(
43 wrapInColor(
44 `Warning: Unknown architecture '${nodeArch}', defaulting to amd64`,
45 ANSI_COLORS.YELLOW_COLOR,
46 ),
47 );
48 return 'amd64';
49 }
50 }
51}
52
53export async function linuxSetup(): Promise<void> {
54 const devSetup = new DevSetupHelper();

Callers 1

linuxSetupFunction · 0.85

Calls 2

wrapInColorFunction · 0.90
logMethod · 0.65

Tested by

no test coverage detected