Closed draeath closed 3 years ago
This is accomplished using the environment variables $TD_DATA, $TD_TMP, $TD_EDDB, which override the default location of the ./data, ./tmp, and ./data/eddb folders respectively with the value set in the envvar, or the command line arguments '--cwd ...', '--db ...', which override the 'top-level' directory and the 'TradeDangerous.db' location with the passed value.
Of the options available, 'trade --cwd ~/.tradedangerous ...' would be the simplest way to accomplish what you want.
Ah. Thanks!
Hello,
By common convention, trade dangerous should be using user-relative profile directories instead of looking for the
data
directory in the CWD.For example, on linux or OSX either
${HOME}/.tradedangerous
, or${HOME}/.config/tradedangerous
or${HOME}/.local/share/tradedangerous
and on windows%appdata%\tradedangerous
In the examples given, ${HOME} can be retrieved via
os.getenv('HOME')
and %appdata% viaos.getenv('APPDATA')
. You can detect the platform (to guide which of those to use) viaplatform.system()
oros.name()
This prevents pollution of home directories and inconsistent results if the CWD is not consistent when running the tool.