From c3c43437536c1d1cc6590fe970797f09bccfc363 Mon Sep 17 00:00:00 2001 From: Ryan Caezar Itang Date: Tue, 2 Apr 2024 00:57:20 +0800 Subject: [PATCH] bun: Add pre_install check for CPU --- bucket/bun.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bucket/bun.json b/bucket/bun.json index 1121b4be4856fb..7c2d8db1ebcbbc 100644 --- a/bucket/bun.json +++ b/bucket/bun.json @@ -12,6 +12,12 @@ "hash": "60e9291d09657ab315bcc6bc07cbf67d2e9b9b18c21bb7cf9ce2d9fa983c9719" } }, + "pre_install": [ + "if (-not (Add-Type -MemberDefinition '[DllImport(\"kernel32.dll\")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);'-Name 'Kernel32'-Namespace 'Win32'-PassThru)::IsProcessorFeaturePresent(40)) {", + " Write-Host -Foreground Red \"This CPU does not support AVX2 instructions. please install 'bun-baseline' instead.\"", + " break", + "}" + ], "extract_dir": "bun-windows-x64", "bin": [ "bun.exe",