From e7e3a8c52cde20abd25cc5be6606768cb59a8315 Mon Sep 17 00:00:00 2001 From: Jack T Date: Fri, 4 Oct 2024 12:16:16 -0700 Subject: [PATCH] Switch binary name based on platform (#49) --- src/biome.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/biome.rs b/src/biome.rs index 407ec55..ccd71dc 100644 --- a/src/biome.rs +++ b/src/biome.rs @@ -21,11 +21,16 @@ impl BiomeExtension { fs::metadata(path).map_or(false, |stat| stat.is_file()) } - fn binary_specifier(&self) -> Result { + fn binary_specifier(&self) -> Result { let (platform, arch) = zed::current_platform(); + let binary_name = match platform { + zed::Os::Windows => "biome.exe", + _ => "biome", + }; + Ok(format!( - "@biomejs/cli-{platform}-{arch}/biome", + "@biomejs/cli-{platform}-{arch}/{binary}", platform = match platform { zed::Os::Mac => "darwin", zed::Os::Linux => "linux", @@ -36,6 +41,7 @@ impl BiomeExtension { zed::Architecture::X8664 => "x64", _ => return Err(format!("unsupported architecture: {arch:?}")), }, + binary = binary_name, )) }