diff third_party/emsdk/scripts/zip.py @ 179:8d17f6e6e290

[ThirdParty] Added emsdk bazel rules that can be supported by bazel 9.0.0
author MrJuneJune <me@mrjunejune.com>
date Thu, 22 Jan 2026 21:23:17 -0800
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/third_party/emsdk/scripts/zip.py	Thu Jan 22 21:23:17 2026 -0800
@@ -0,0 +1,19 @@
+import os
+
+
+def unzip_cmd():
+    # Use 7-Zip if available (https://www.7-zip.org/)
+    sevenzip = os.path.join(os.getenv('ProgramFiles', ''), '7-Zip', '7z.exe')
+    if os.path.isfile(sevenzip):
+        return [sevenzip, 'x']
+    # Fall back to 'unzip' tool
+    return ['unzip', '-q']
+
+
+def zip_cmd():
+    # Use 7-Zip if available (https://www.7-zip.org/)
+    sevenzip = os.path.join(os.getenv('ProgramFiles', ''), '7-Zip', '7z.exe')
+    if os.path.isfile(sevenzip):
+        return [sevenzip, 'a', '-mx9']
+    # Fall back to 'zip' tool
+    return ['zip', '-rq']