fix: bazel/emscripten_toolchain/wasm_binary.py command output without mimetype on MacOS. (#682)
Co-authored-by: xulinfeng <xulinfeng@bilibili.com>
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import os
|
||||
import platform
|
||||
|
||||
ROOT_DIR = os.environ["ROOT_DIR"]
|
||||
EMSCRIPTEN_ROOT = os.environ["EMSCRIPTEN"]
|
||||
|
||||
LLVM_ROOT = ROOT_DIR + "/external/emscripten/bin"
|
||||
EMSCRIPTEN_NATIVE_OPTIMIZER = LLVM_ROOT + "/optimizer"
|
||||
NODE_JS = ROOT_DIR + "/external/nodejs_linux_amd64/bin/node"
|
||||
BINARYEN_ROOT = ROOT_DIR + "/external/emscripten"
|
||||
|
||||
system = platform.system()
|
||||
nodejs_binary = "node.exe" if(system =="Windows") else "bin/node"
|
||||
NODE_JS = ROOT_DIR + "/external/nodejs_{}_amd64/{}".format(system.lower(), nodejs_binary)
|
||||
BINARYEN_ROOT = ROOT_DIR + "/external/emscripten"
|
||||
@@ -46,7 +46,7 @@ def main(argv):
|
||||
stem = basename.split('.')[0]
|
||||
|
||||
# Check the type of the input file
|
||||
mimetype_bytes = subprocess.check_output(['file', '-Lib', FLAGS.archive])
|
||||
mimetype_bytes = subprocess.check_output(['file', '-Lb', '--mime-type', '--mime-encoding', FLAGS.archive])
|
||||
mimetype = mimetype_bytes.decode(sys.stdout.encoding)
|
||||
|
||||
# If we have a tar, extract all files. If we have just a single file, copy it.
|
||||
|
||||
Reference in New Issue
Block a user