Skip to content

Conversation

@ryjm
Copy link

@ryjm ryjm commented Dec 19, 2025

Summary

path.join() doesn't expand tilde, so when process.env.HOME is undefined,
the fallback to '~' created literal directories named '~/' instead of
expanding to the user's home.

This caused the proliferation of confusing '~/' directories containing
.efrit/logs/. It's also kind of terrifying to try and remove.

Fix

  • Import os module
  • Use os.homedir() as fallback instead of literal '~' string

Before

const defaultLogFile = path.join(process.env['HOME'] || '~', '.efrit', 'logs', 'mcp-server.log');

After

const homeDir = process.env['HOME'] || os.homedir();
const defaultLogFile = path.join(homeDir, '.efrit', 'logs', 'mcp-server.log');

path.join() doesn't expand tilde, so when process.env.HOME is undefined,
the fallback to '~' created literal directories named '~/' instead of
expanding to the user's home.

This caused the proliferation of confusing '~/' directories containing
.efrit/logs/. It's also kind of terrifying to try and remove.
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.

1 participant