Fix error handling: untargz() in emsdk.py (#895)
Make untargz() in emsdk.py return False if tar command failed.
This commit is contained in:
4
emsdk.py
4
emsdk.py
@@ -539,10 +539,10 @@ def untargz(source_filename, dest_dir, unpack_even_if_exists=False):
|
|||||||
return True
|
return True
|
||||||
print("Unpacking '" + source_filename + "' to '" + dest_dir + "'")
|
print("Unpacking '" + source_filename + "' to '" + dest_dir + "'")
|
||||||
mkdir_p(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 = tarfile.open(source_filename, 'r:gz')
|
||||||
# tfile.extractall(dest_dir)
|
# tfile.extractall(dest_dir)
|
||||||
return True
|
return returncode == 0
|
||||||
|
|
||||||
|
|
||||||
# On Windows, it is not possible to reference path names that are longer than
|
# On Windows, it is not possible to reference path names that are longer than
|
||||||
|
|||||||
Reference in New Issue
Block a user