Bazel Windows Support (#929)

This commit is contained in:
Ezekiel Warren
2021-12-20 11:24:56 -08:00
committed by GitHub
parent bb9a6a326f
commit 774b871eca
16 changed files with 110 additions and 33 deletions

View File

@@ -20,7 +20,7 @@ WebAssembly binary into a larger web application.
import argparse
import os
import subprocess
import tarfile
def ensure(f):
@@ -40,12 +40,14 @@ def main():
parser.add_argument('--output_path', help='The path to extract into.')
args = parser.parse_args()
args.archive = os.path.normpath(args.archive)
basename = os.path.basename(args.archive)
stem = basename.split('.')[0]
# Extract all files from the tarball.
subprocess.check_call(
['tar', 'xf', args.archive, '-C', args.output_path])
tar = tarfile.open(args.archive)
tar.extractall(args.output_path)
# At least one of these two files should exist at this point.
ensure(os.path.join(args.output_path, stem + '.js'))