fix: npm-real launcher (npm is a JS symlink, mv broke it); keep .git in vendored git: packages (pi runs git fetch on existing installs)

This commit is contained in:
Raphael Westphal
2026-08-19 11:08:22 +02:00
parent cbf52d2b76
commit 0bfa55a94a
5 changed files with 16 additions and 13 deletions
+2 -1
View File
@@ -59,7 +59,8 @@ for pkg in settings.get("packages") or []:
subprocess.run(["git", "clone", "--quiet", url, str(target)], check=True)
if ref:
subprocess.run(["git", "checkout", "--quiet", ref], cwd=target, check=True)
shutil.rmtree(target / ".git", ignore_errors=True)
# keep .git: pi's package manager runs `git fetch` + `rev-parse` on
# existing installs; a stripped dir would fail resolution.
if (target / "package.json").exists():
npm = "/usr/bin/npm" if Path("/usr/bin/npm").exists() else "npm"
subprocess.run(