kaizen-agent 1.6.3 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/install.ts +9 -7
- package/package.json +1 -1
package/cli/install.ts
CHANGED
|
@@ -478,20 +478,22 @@ async function resolveRepoQuietly() {
|
|
|
478
478
|
|
|
479
479
|
async function resolveRepo() {
|
|
480
480
|
const here = dirname(import.meta.dir);
|
|
481
|
-
if (existsSync(join(here, ".git"))) return here;
|
|
482
|
-
|
|
483
481
|
const dest = process.env.KAIZEN_HOME ?? join(home, "kaizen");
|
|
484
|
-
|
|
482
|
+
// The launcher runs the clone itself, so an upgrade from inside it must pull
|
|
483
|
+
// that clone -- returning it untouched was "Up to date" at whatever was there.
|
|
484
|
+
for (const dir of [here, dest]) {
|
|
485
|
+
if (!existsSync(join(dir, ".git"))) continue;
|
|
486
|
+
if (!upgrade && dir === here) return dir;
|
|
485
487
|
// A pull can refuse for reasons that have nothing to do with linking -- local
|
|
486
488
|
// edits, a detached head, no network. Linking the checkout already on disk
|
|
487
489
|
// still works, so say what happened and carry on.
|
|
488
490
|
try {
|
|
489
|
-
await Bun.$`git -C ${
|
|
490
|
-
step(`updated ${tilde(
|
|
491
|
+
await Bun.$`git -C ${dir} pull --ff-only`.quiet();
|
|
492
|
+
step(`updated ${tilde(dir)}`);
|
|
491
493
|
} catch {
|
|
492
|
-
step(`kept ${tilde(
|
|
494
|
+
step(`kept ${tilde(dir)} ${c.dim("(could not pull)")}`);
|
|
493
495
|
}
|
|
494
|
-
return
|
|
496
|
+
return dir;
|
|
495
497
|
}
|
|
496
498
|
// A copy made before git was installed can never be pulled, so it keeps upgrading
|
|
497
499
|
// through npm and its caches. Once git is here, replace it with a real clone --
|
package/package.json
CHANGED