CHollingworth / Lampray

Linux Application Modding Platform. A native Linux mod manager.

Home Page:https://www.nexusmods.com/baldursgate3/mods/2169

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lampray should not write files to the cwd from where you call the app

rykugur opened this issue · comments

Is your feature request related to a problem? Please describe.
I'm a nixOS user and wrote a custom derivation to build Lampray from source, overriding the baseDataPath before building as such:

    sed -i 's|const lampString baseDataPath = "Lamp_Data/";|const lampString baseDataPath = ((std::string)std::getenv("HOME")) + "/.lamp/";|g' Lampray/Control/lampConfig.h

This mostly works, however some files are still dropped into the current directory (wherever I call Lampray from):

?? Lamp_Language/
?? imgui.ini
?? lamp.log

In this case I happened to be in my nix-config git repo at the time.

Describe the solution you'd like
I pulled my solution from now-closed issue: #92 so I understand that it was designed this way on purpose. However, I do not think these files should just be dropped into place wherever the user happens to be. This causes file clutter.

Does it make sense for these files to also end up in baseDataPath?

Describe alternatives you've considered
Will look into creating a PR, but my C++ experience is quite old.

Additional context
A link to my custom derivation, for reference: https://github.com/rykugur/dotfiles/blob/master/pkgs/lampray/default.nix

Same comment as I made over at the other issue:

My 2¢: IMO the “by the book” solution would be to use ${XDG_CONFIG_HOME:-~/.config}/lampray/ and ${XDG_DATA_HOME:-~/.local/share}/lampray/ by default, then have some runtime flag like --portable that contains it to the same folder as the executable, not your current working directory.