fix: honor CLAUDE_CONFIG_DIR in hooks (#37)
ponytail-activate.js and ponytail-runtime.js hardcoded ~/.claude for the flag file and settings lookup, ignoring CLAUDE_CONFIG_DIR. Add a shared getClaudeDir() to ponytail-config.js and use it in both. Regression test added to hooks.test.js. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
6d990f8c54
commit
01578c0cd4
@@ -50,6 +50,11 @@ function getConfigPath() {
|
||||
return path.join(getConfigDir(), 'config.json');
|
||||
}
|
||||
|
||||
function getClaudeDir() {
|
||||
// ponytail: CLAUDE_CONFIG_DIR overrides ~/.claude, matching Claude Code.
|
||||
return process.env.CLAUDE_CONFIG_DIR || path.join(os.homedir(), '.claude');
|
||||
}
|
||||
|
||||
function getDefaultMode() {
|
||||
// 1. Environment variable (highest priority)
|
||||
const envMode = process.env.PONYTAIL_DEFAULT_MODE;
|
||||
@@ -89,6 +94,7 @@ module.exports = {
|
||||
getDefaultMode,
|
||||
getConfigDir,
|
||||
getConfigPath,
|
||||
getClaudeDir,
|
||||
normalizeMode,
|
||||
normalizeConfigMode,
|
||||
normalizePersistedMode,
|
||||
|
||||
Reference in New Issue
Block a user