fix: fix corepack install command (remove bad input/stdin)

This commit is contained in:
iamninja committed 2026-10-05 14:35:58 +05:00
1 parent fe754e15b9
commit 7e08280539
1 file changed
+16 -20
+16 -20
View File
@@ -2172,37 +2172,33 @@ def _build_frontend(src_frontend: Path, dest_frontend: Path):
if shutil.which("corepack"): if shutil.which("corepack"):
try: try:
# Enable corepack # Enable corepack
result = subprocess.run( subprocess.run(
["corepack", "enable"], ["corepack", "enable"],
input="",
stdin=subprocess.PIPE,
capture_output=True, capture_output=True,
timeout=10, timeout=10,
check=False,
)
# Install Yarn stable (4.x)
result = subprocess.run(
["corepack", "install", "-g", "yarn@stable"],
capture_output=True,
timeout=60,
text=True, text=True,
check=False, check=False,
) )
if result.returncode == 0 or "already" in (result.stderr or "").lower(): if result.returncode == 0:
# Install Yarn stable (4.x) # Activate it
result = subprocess.run( subprocess.run(
["corepack", "install", "-g", "yarn@stable"], ["corepack", "prepare", "yarn@stable", "--activate"],
capture_output=True, capture_output=True,
timeout=60, timeout=30,
text=True,
check=False, check=False,
) )
if result.returncode == 0: # Check version
# Activate it if shutil.which("yarn"):
subprocess.run(
["corepack", "prepare", "yarn@stable", "--activate"],
capture_output=True,
timeout=30,
check=False,
)
# Check version
if shutil.which("yarn"):
major = _get_yarn_major_version(["yarn"]) major = _get_yarn_major_version(["yarn"])
if major and major >= 4: if major and major >= 4: