fix ./emsdk update of a *non*-git install (#271)

The non-git case was not well documented and not tested, and it was broken since we switched the build infrastructure.

In the git case, an update is to do a git pull. In the non-git case, it downloads a zip and unpacks it. The old build infra apparently had builds created for this; instead, I made it download it directly from github. Perhaps we should consider creating builds for this as well eventually?

Also add a test for this, so we never break it again.
This commit is contained in:
Alon Zakai
2019-06-10 16:38:54 -07:00
committed by GitHub
parent fc0ed1e17c
commit c0e1167aad
2 changed files with 17 additions and 8 deletions

14
test.py
View File

@@ -1,6 +1,8 @@
import os
import shutil
import subprocess
import sys
import tempfile
# Utilities
@@ -77,3 +79,15 @@ print('test 32-bit error')
failing_call_with_output('python %s install latest' % hack_emsdk('not is_os_64bit()', 'True'), 'this tool is only provided for 64-bit OSes')
print('test non-git update')
temp_dir = tempfile.mkdtemp()
for filename in os.listdir('.'):
if not filename.startswith('.') and not os.path.isdir(filename):
shutil.copyfile(filename, os.path.join(temp_dir, filename))
os.chdir(temp_dir)
check_call('python ./emsdk update')