refactor: unify runtime directories and environment variables to HAPI_HOME

Consolidate CLI and server runtime directories from ~/.config/hapi/ (CLI) and ~/.hapi-server/ (Server) to a single ~/.hapi/ directory. Unify environment variables from HAPI_HOME_DIR (CLI) and HAPI_BOT_DATA_DIR (Server) to a single HAPI_HOME variable across both applications. Update all documentation and configuration references accordingly. Bump bun-types to 1.3.5.
This commit is contained in:
weishu
2025-12-21 19:17:07 +08:00
parent bf72e0dc3b
commit 81852a3176
15 changed files with 28 additions and 26 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
*
* Handles CLI_API_TOKEN initialization with priority:
* 1. Environment variable (highest - allows temporary override)
* 2. Settings file (~/.config/hapi/settings.json)
* 2. Settings file (~/.hapi/settings.json)
* 3. Interactive prompt (only when both above are missing)
*/
@@ -57,7 +57,7 @@ async function promptForToken(): Promise<string> {
if (!token.trim()) {
throw new Error('Token cannot be empty')
}
console.log(chalk.green('\nToken saved to ~/.config/hapi/settings.json'))
console.log(chalk.green(`\nToken saved to ${configuration.settingsFile}`))
return token.trim()
} finally {
rl.close()