mirror of
https://github.com/zulip/zulip.git
synced 2025-10-31 20:13:46 +00:00
node_cache: Extract cached_node_modules variable.
This commit is contained in:
@@ -58,10 +58,10 @@ def do_npm_install(target_path, npm_args, success_stamp, stdout=None, stderr=Non
|
|||||||
['mkdir', '-p', target_path],
|
['mkdir', '-p', target_path],
|
||||||
['cp', 'package.json', target_path],
|
['cp', 'package.json', target_path],
|
||||||
]
|
]
|
||||||
|
cached_node_modules = os.path.join(target_path, 'node_modules')
|
||||||
if copy_modules:
|
if copy_modules:
|
||||||
print("Cached version not found! Copying node modules.")
|
print("Cached version not found! Copying node modules.")
|
||||||
cmds.append(["cp", "-rT", "prod-static/serve/node_modules",
|
cmds.append(["cp", "-rT", "prod-static/serve/node_modules", cached_node_modules])
|
||||||
os.path.join(target_path, "node_modules")])
|
|
||||||
else:
|
else:
|
||||||
print("Cached version not found! Installing node modules.")
|
print("Cached version not found! Installing node modules.")
|
||||||
cmds.append(['npm', 'install'] + npm_args + ['--prefix', target_path])
|
cmds.append(['npm', 'install'] + npm_args + ['--prefix', target_path])
|
||||||
|
|||||||
Reference in New Issue
Block a user