-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ignoring the system-wide configuration file #2993
Comments
you could just set the
Well, the readme clearly states:
So there's no reason for that not to apply just because of specifying a different location for the user config file. I imagine there are use cases where you have machine-level config which you always want to apply and you want to override it differently in different scenarios with different user config files. |
Adding on to what you said, I don't think environment variables are appropriate for this purpose. It comes across as antithetical to have a program use its environment to decide if it should ignore said environment. Also: One would have to export the hypothetical environment variable in their shell profile as well, so it wouldn't even be "portable" in the sense that you could run it anywhere and expect the same behavior everywhere. In my opinion, a portable version of |
That variable is compile-time only, I cannot set it at runtime.
Fair point. |
Generally, there are two types of portable apps:
Most systems for packaging portable apps, such as PortableApps.com, portapps, Scoop, and my own Pog have a way to easily generate launchers. Additionally, all of the projects prefer to use existing releases, since building a custom version from source adds complexity, and requires the maintainer to redistribute the binaries, which is against commonly-used proprietary licenses (not an issue with For these projects, option 2. is preferred, since the packages should have a fixed, consistent structure, which is often not achievable with option 1. For more details about the options for passing the configuration, you might be interested in Section 4 ("Making applications portable") of my thesis (https://matejkafka.com/share/Pog-thesis.pdf). |
I'm using
bat
as a portable application, which can be moved between computers and stores all data next to the binary; portable applications should not depend on the configuration of a particular system.bat
supports a user-level configuration file, whose path can be set usingBAT_CONFIG_PATH
, and a system-wide configuration file stored inC:\ProgramData
on Windows, with a fixed path that cannot be changed by the user or disabled (btw, you probably should not hardcode this path, since theProgramData
directory may move; instead, ask the system usingSHGetKnownFolderPath
).For the portable scenario (and using a custom configuration file in general), I don't see much value in having multiple layered configuration files, so it should be enough to have a way to prevent
bat
from using the system-wide configuration file.I see two ways to implement this feature:
BAT_IGNORE_SYSTEMWIDE_CONFIG=1
.BAT_CONFIG_FILE
is set. If a user overrides the user-level config path, I think they would not expectbat
to still use the system-wide path, but I might be wrong. :)I have a minor preference for option 2., but either one is fine with me.
The text was updated successfully, but these errors were encountered: