mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
This reverts commit 126f3b5f47
.
Testing showed that it was ineffective for many users.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
27 lines
599 B
Python
27 lines
599 B
Python
import os
|
|
|
|
from scripts.lib.zulip_tools import run
|
|
|
|
DEFAULT_PRODUCTION = False
|
|
|
|
|
|
def setup_node_modules(production: bool = DEFAULT_PRODUCTION) -> None:
|
|
if os.path.islink("node_modules"):
|
|
os.unlink("node_modules")
|
|
|
|
try:
|
|
with open("node_modules/.pnpm/lock.yaml") as a, open("pnpm-lock.yaml") as b:
|
|
if a.read() == b.read():
|
|
return
|
|
except FileNotFoundError:
|
|
pass
|
|
|
|
run(
|
|
[
|
|
"/usr/local/bin/pnpm",
|
|
"install",
|
|
"--frozen-lockfile",
|
|
*(["--prod"] if production else []),
|
|
]
|
|
)
|