fix(install): update installs a checkout without upstream as it is; the startup report no longer asks for a Claude token
This commit is contained in:
+8
-3
@@ -338,9 +338,14 @@ def update(config):
|
||||
if active:
|
||||
raise RuntimeError(f"{len(active)} run(s) are still executing; update after they finish")
|
||||
if (source / ".git").exists():
|
||||
pulled = subprocess.run(["git", "-C", str(source), "pull", "--ff-only"], text=True)
|
||||
if pulled.returncode:
|
||||
raise RuntimeError("git pull --ff-only failed; resolve the checkout, then rerun `pipelines update`")
|
||||
upstream = subprocess.run(["git", "-C", str(source), "rev-parse", "--abbrev-ref", "@{u}"],
|
||||
capture_output=True, text=True)
|
||||
if upstream.returncode:
|
||||
print("The checkout tracks no upstream branch; installing it as it is.")
|
||||
else:
|
||||
pulled = subprocess.run(["git", "-C", str(source), "pull", "--ff-only"], text=True)
|
||||
if pulled.returncode:
|
||||
raise RuntimeError("git pull --ff-only failed; resolve the checkout, then rerun `pipelines update`")
|
||||
installed = subprocess.run(["sh", str(source / "install.sh"), *config.get("install_args", [])])
|
||||
if installed.returncode:
|
||||
raise RuntimeError("The installer failed; the previous version keeps running")
|
||||
|
||||
@@ -194,7 +194,7 @@ class ManageNativeTests(unittest.TestCase):
|
||||
patch.object(manage, "stop") as stop, patch.object(manage, "start") as start, \
|
||||
patch.object(manage, "report") as report:
|
||||
manage.update(config)
|
||||
self.assertEqual(calls, [["sh", str(source / "install.sh"), "--port", "18180"]])
|
||||
self.assertEqual(calls[-1], ["sh", str(source / "install.sh"), "--port", "18180"])
|
||||
stop.assert_called_once()
|
||||
start.assert_called_once()
|
||||
report.assert_called_once()
|
||||
|
||||
Reference in New Issue
Block a user