Skip to content

fix: skip home-based config paths when $HOME is not set#406

Merged
antonmedv merged 1 commit into
antonmedv:masterfrom
umut-polat:fix/no-home-panic
Mar 28, 2026
Merged

fix: skip home-based config paths when $HOME is not set#406
antonmedv merged 1 commit into
antonmedv:masterfrom
umut-polat:fix/no-home-panic

Conversation

@umut-polat
Copy link
Copy Markdown
Contributor

When $HOME is not defined (e.g. running as a system user or in a minimal container), os.UserHomeDir returns an error. Previously readFxrc propagated this error, which caused a panic in init():

panic: get home: $HOME is not defined

This change skips the home-based config paths (~/.fxrc.js and ~/.config/fx/.fxrc.js) when the home directory is unavailable, instead of failing. The CWD-based .fxrc.js and XDG_CONFIG_DIRS paths still work, and XDG_CONFIG_HOME is honored if explicitly set.

Fixes #397

When $HOME is not defined, os.UserHomeDir returns an error. Previously
this caused readFxrc to return an error, which panicked in init().

Instead, skip the home-based paths (~/.fxrc.js and ~/.config/fx/.fxrc.js)
when the home directory is unavailable. XDG_CONFIG_HOME is still honored
if explicitly set.

Fixes antonmedv#397
@antonmedv antonmedv merged commit d9f75a1 into antonmedv:master Mar 28, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panic: get home: $HOME is not defined

2 participants