fix(bar): correct the already-running reinstall hint

'open -a' only activates a running app, so suggesting 'ccs bar' as an
alternative to quitting could not load the new binary. The hint now
says to quit from the menu bar first, then run 'ccs bar' to relaunch
the updated app.
This commit is contained in:
Tam Nhu Tran
2026-06-10 15:25:55 -04:00
parent 3438c3940e
commit 3aab14ca85
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -681,7 +681,7 @@ export async function handleBarInstall(
if (barIsRunning && !forceLaunch) {
console.log(
'[!] CCS Bar is currently running the previous version. Quit and reopen it (or run `ccs bar`) to use the update.'
'[!] CCS Bar is currently running an older build. Quit it from the menu bar, then run `ccs bar` to relaunch the updated app.'
);
} else if (forceLaunch) {
await launchBar([]);
+6 -5
View File
@@ -2622,8 +2622,9 @@ describe('bar install: already-running detection (Finding 3)', () => {
const allOutput = consoleOutput.join('\n');
// Must print the restart hint
expect(allOutput).toMatch(/currently running the previous version/i);
expect(allOutput).toMatch(/Quit and reopen/i);
expect(allOutput).toMatch(/currently running an older build/i);
expect(allOutput).toMatch(/Quit it from the menu bar/i);
expect(allOutput).toMatch(/run `ccs bar` to relaunch/i);
});
it('when not running after install: prompt path unchanged', async () => {
@@ -2646,7 +2647,7 @@ describe('bar install: already-running detection (Finding 3)', () => {
expect(promptCalled).toBe(true);
const allOutput = consoleOutput.join('\n');
// The restart hint must NOT appear when bar is not running
expect(allOutput).not.toMatch(/currently running the previous version/i);
expect(allOutput).not.toMatch(/currently running an older build/i);
});
it('pgrep error treated as not running: prompt path unchanged', async () => {
@@ -2670,7 +2671,7 @@ describe('bar install: already-running detection (Finding 3)', () => {
// pgrep error treated as not running → normal prompt flow
expect(promptCalled).toBe(true);
const allOutput = consoleOutput.join('\n');
expect(allOutput).not.toMatch(/currently running the previous version/i);
expect(allOutput).not.toMatch(/currently running an older build/i);
});
it('--launch with bar already running: launchBar still invoked', async () => {
@@ -2693,7 +2694,7 @@ describe('bar install: already-running detection (Finding 3)', () => {
expect(launchCalled).toBe(true);
// Restart hint must NOT appear when --launch is passed
const allOutput = consoleOutput.join('\n');
expect(allOutput).not.toMatch(/currently running the previous version/i);
expect(allOutput).not.toMatch(/currently running an older build/i);
});
});