node_cache: Don’t retry copying node_modules; let yarn do its thing.

`copytree` throws an error if the target already exists, and we don’t
really want to rerun the copy anyway.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2019-10-28 16:49:23 -07:00 committed by Tim Abbott
parent d4443bc4f8
commit d6377b00c0
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ def do_yarn_install(target_path, yarn_args, success_stamp, stdout=None, stderr=N
print("Cached version not found! Installing node modules.")
# Copy the existing node_modules to speed up install
if os.path.exists("node_modules"):
if os.path.exists("node_modules") and not os.path.exists(cached_node_modules):
shutil.copytree("node_modules/", cached_node_modules, symlinks=True)
if os.environ.get('CUSTOM_CA_CERTIFICATES'):
run([YARN_BIN, "config", "set", "cafile", os.environ['CUSTOM_CA_CERTIFICATES']],