Fix error handling: untargz() in emsdk.py (#895)

Make untargz() in emsdk.py return False if tar command failed.
This commit is contained in:
Matt Gucci
2021-09-21 02:02:01 +09:00
committed by GitHub
parent b946a4786a
commit deb6453391

View File

@@ -539,10 +539,10 @@ def untargz(source_filename, dest_dir, unpack_even_if_exists=False):
return True
print("Unpacking '" + source_filename + "' to '" + dest_dir + "'")
mkdir_p(dest_dir)
run(['tar', '-xvf' if VERBOSE else '-xf', sdk_path(source_filename), '--strip', '1'], cwd=dest_dir)
returncode = run(['tar', '-xvf' if VERBOSE else '-xf', sdk_path(source_filename), '--strip', '1'], cwd=dest_dir)
# tfile = tarfile.open(source_filename, 'r:gz')
# tfile.extractall(dest_dir)
return True
return returncode == 0
# On Windows, it is not possible to reference path names that are longer than