From 0a94954366ace65130c6192d1976d894a9ee6569 Mon Sep 17 00:00:00 2001 From: Kwangsoo Yeo Date: Thu, 5 Dec 2024 13:30:31 -0800 Subject: [PATCH] fix build --- binding/nodejs/test/test_utils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/binding/nodejs/test/test_utils.ts b/binding/nodejs/test/test_utils.ts index f9a23a9d..f63d8b90 100644 --- a/binding/nodejs/test/test_utils.ts +++ b/binding/nodejs/test/test_utils.ts @@ -37,6 +37,9 @@ export function getAudioFile(audioFile: string): string { } function getCpuPart(): string { + if (!fs.existsSync('/proc/cpuinfo')) { + return ""; + } const cpuInfo = fs.readFileSync('/proc/cpuinfo', 'ascii'); for (const infoLine of cpuInfo.split('\n')) { if (infoLine.includes('CPU part')) { @@ -44,7 +47,7 @@ function getCpuPart(): string { return infoLineSplit[infoLineSplit.length - 1].toLowerCase(); } } - throw new Error(`Unsupported CPU.`); + return ""; } function getModelSize(language: string): number {