Skip to content

Commit f2d50c8

Browse files
fix(uninstall): remove the OpenCode mode flag (#1104)
uninstall now also removes $XDG_CONFIG_HOME/opencode/.ponytail-active (or ~/.config/opencode/.ponytail-active), the flag the OpenCode plugin writes.
1 parent 8b50c44 commit f2d50c8

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
@@ -37,6 +37,12 @@ const qoderCustomFlagPath = path.join(qoderCustomDir, '.ponytail-active');
3737
fs.mkdirSync(qoderCustomDir, { recursive: true });
3838
fs.writeFileSync(qoderCustomFlagPath, 'lite');
3939

40+
// OpenCode keeps its flag beside its own config; a leftover "off" would start a
41+
// reinstall switched off.
42+
const opencodeFlagPath = path.join(temp, 'config-home', 'opencode', '.ponytail-active');
43+
fs.mkdirSync(path.dirname(opencodeFlagPath), { recursive: true });
44+
fs.writeFileSync(opencodeFlagPath, 'off');
45+
4046
const nudgeFlagPath = path.join(claudeDir, '.ponytail-statusline-nudged');
4147
fs.writeFileSync(nudgeFlagPath, '');
4248

@@ -84,6 +90,7 @@ let result = runUninstall(env);
8490
assert.equal(result.status, 0, result.stderr);
8591
assert.equal(fs.existsSync(flagPath), false, 'mode flag must be removed');
8692
assert.equal(fs.existsSync(qoderFlagPath), false, 'Qoder mode flag must be removed');
93+
assert.equal(fs.existsSync(opencodeFlagPath), false, 'OpenCode mode flag must be removed');
8794
assert.equal(fs.existsSync(qoderCustomFlagPath), true, 'default Qoder uninstall must not touch a separate custom config');
8895
assert.equal(fs.existsSync(nudgeFlagPath), false, 'statusline nudge flag must be removed');
8996
assert.equal(fs.existsSync(configPath), false, 'config file must be removed');

0 commit comments

Comments
 (0)