fix: respect home overrides in hook utilities

This commit is contained in:
Affaan Mustafa
2026-04-02 18:22:07 -07:00
parent 8bd5a7a5d9
commit b10080c7dd
3 changed files with 49 additions and 0 deletions

View File

@@ -25,6 +25,10 @@ const WINDOWS_RESERVED_SESSION_IDS = new Set([
* Get the user's home directory (cross-platform)
*/
function getHomeDir() {
const explicitHome = process.env.HOME || process.env.USERPROFILE;
if (explicitHome && explicitHome.trim().length > 0) {
return path.resolve(explicitHome);
}
return os.homedir();
}