[COMPASS-5404] Avoid creation of ~/.mongodb directory Created: 12/Jan/22  Updated: 17/May/23

Status: Open
Project: Compass
Component/s: Plugins
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Óscar García Amor Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to MONGOSH-1070 Support XDG Base Directory Specifica... Open
Story Points: 3

 Description   

This issue is related with https://jira.mongodb.org/browse/MONGOSH-1070

 
Describe the bug
Now the app is creating the directory ~/.mongodb instead of use ${XDG_CACHE_HOME}/mongodb/ or ${XDG_DATA_HOME}/mongodb/.
 

To Reproduce
Steps to reproduce the behavior:

  1. Open app

 

Expected behavior
That the app follows the XDG Base Directory Specification
 

Additional context
As side note in Linux $XDG_CACHE_HOME or $XDG_DATA_HOME may not be declared, in this case must fallback to /.cache and /.local respectively.

For example in BASH (for $XDG_CACHE_HOME, $XDG_DATA_HOME is the same way:

MONGODB_DIR=${XDG_CACHE_HOME:-~/.cache}/mongodb

Or in Python:

mongodb_dir = os.path.join(os.environ.get('XDG_CACHE_HOME', os.path.join(os.path.expanduser('~'), '.cache')), 'mongodb')


Generated at Wed Feb 07 22:39:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.