Skip to content

Commit b0017e0

Browse files
fix(uninstall): remove the OpenCode mode flag
scripts/uninstall.js cleaned up every host's flag except OpenCode's ($XDG_CONFIG_HOME or ~/.config)/opencode/.ponytail-active. A flag left at "off" made a later reinstall start switched off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9b58c1f commit b0017e0

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎scripts/uninstall.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ for (const dir of [path.join(getClaudeDir(), 'ponytail-modes'), path.join(os.hom
3434
}
3535
}
3636
removeIfExists(path.join(process.env.CODEBUDDY_CONFIG_DIR || path.join(os.homedir(), '.codebuddy'), '.ponytail-active'), 'CodeBuddy mode flag');
37+
removeIfExists(path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'opencode', '.ponytail-active'), 'OpenCode mode flag');
3738
removeIfExists(getConfigPath(), 'config file');
3839
// Statusline script copies the activate hook keeps in the config dir (#1032).
3940
for (const name of ['ponytail-statusline.sh', 'ponytail-statusline.ps1']) {

‎tests/uninstall.test.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ const qoderFlagPath = path.join(home, '.qoder', '.ponytail-active');
3333
fs.mkdirSync(path.dirname(qoderFlagPath), { recursive: true });
3434
fs.writeFileSync(qoderFlagPath, 'ultra');
3535

36+
// OpenCode keeps its flag beside its own config; a leftover "off" would start a
37+
// reinstall switched off.
38+
const opencodeFlagPath = path.join(temp, 'config-home', 'opencode', '.ponytail-active');
39+
fs.mkdirSync(path.dirname(opencodeFlagPath), { recursive: true });
40+
fs.writeFileSync(opencodeFlagPath, 'off');
41+
3642
const nudgeFlagPath = path.join(claudeDir, '.ponytail-statusline-nudged');
3743
fs.writeFileSync(nudgeFlagPath, '');
3844

@@ -80,6 +86,7 @@ let result = runUninstall(env);
8086
assert.equal(result.status, 0, result.stderr);
8187
assert.equal(fs.existsSync(flagPath), false, 'mode flag must be removed');
8288
assert.equal(fs.existsSync(qoderFlagPath), false, 'Qoder mode flag must be removed');
89+
assert.equal(fs.existsSync(opencodeFlagPath), false, 'OpenCode mode flag must be removed');
8390
assert.equal(fs.existsSync(nudgeFlagPath), false, 'statusline nudge flag must be removed');
8491
assert.equal(fs.existsSync(configPath), false, 'config file must be removed');
8592
assert.equal(fs.existsSync(cursorFlagPath), false, 'Cursor mode flag must be removed');

0 commit comments

Comments
 (0)