Skip to content

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(cli): skip restart outro when no upgrade is available

jkomynof1c2d7bb4ad6
diff --git a/ts/packages/cli/src/services/upgrade-binary.ts b/ts/packages/cli/src/services/upgrade-binary.ts
index 9de5691d0..44072b8a0 100644
--- a/ts/packages/cli/src/services/upgrade-binary.ts
+++ b/ts/packages/cli/src/services/upgrade-binary.ts
@@ -328,13 +328,13 @@ export class UpgradeBinary extends Effect.Service<UpgradeBinary>()('services/Upg
return;
}
- yield* ui.useMakeSpinner('Checking for updates...', spinner =>
+ const didUpgrade = yield* ui.useMakeSpinner('Checking for updates...', spinner =>
Effect.gen(function* () {
const release = yield* fetchLatestRelease();
const updateAvailable = yield* isUpdateAvailable(release);
if (!updateAvailable) {
yield* spinner.stop('You are already running the latest version!');
- return;
+ return false;
}
yield* spinner.message(
@@ -364,9 +364,13 @@ export class UpgradeBinary extends Effect.Service<UpgradeBinary>()('services/Upg
yield* replaceBinary(extractedBinaryPath, currentPath);
yield* spinner.stop('Upgrade completed!');
+ return true;
})
);
- yield* ui.outro('Restart your terminal to use the new version.');
+
+ if (didUpgrade) {
+ yield* ui.outro('Restart your terminal to use the new version.');
+ }
});
return {