File skip_version_check.patch of Package wasm-pack

From 53b1d6d6b40a82fa2a56deb0af84f70dc5ed4246 Mon Sep 17 00:00:00 2001
From: Dominik Heidler <dheidler@suse.de>
Date: Thu, 20 Mar 2025 21:22:33 +0100
Subject: [PATCH] Add env option SKIP_VERSION_CHECK forcing wasm-pack to use
 what's there

This is especially useful within distro build environments
---
 src/install/mod.rs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/install/mod.rs b/src/install/mod.rs
index bbc9a645..acc0a8e4 100644
--- a/src/install/mod.rs
+++ b/src/install/mod.rs
@@ -65,7 +65,9 @@ pub fn download_prebuilt_or_cargo_install(
     // `cargo install`, for example.
     if let Ok(path) = which(tool.to_string()) {
         debug!("found global {} binary at: {}", tool, path.display());
-        if check_version(&tool, &path, version)? {
+        if check_version(&tool, &path, version)?
+            || env::var("SKIP_VERSION_CHECK").map_or(false, |v| v == "1")
+        {
             let download = Download::at(path.parent().unwrap());
             return Ok(Status::Found(download));
         }
openSUSE Build Service is sponsored by