-
-
Notifications
You must be signed in to change notification settings - Fork 71
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
Parse a configuration file #274
Conversation
Thanks for your pull request, @wilzbach! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. |
@@ -124,17 +124,19 @@ check_tools() { | |||
|
|||
# ------------------------------------------------------------------------------ | |||
|
|||
mkdir -p "$ROOT" | |||
TMP_ROOT=$(mktemp -d "$ROOT/.installer_tmp_XXXXXX") | |||
init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be done after the configuration and CLI arguments are read.
Note that at the moment even if --path
was set, the temporary directory was ~/dlang/.installer_tmp
.
Codecov Report
@@ Coverage Diff @@
## master #274 +/- ##
==========================================
- Coverage 69.81% 69.61% -0.21%
==========================================
Files 1 1
Lines 328 362 +34
==========================================
+ Hits 229 252 +23
- Misses 99 110 +11
Continue to review full report at Codecov.
|
Interesting, what other config options come to mind? We could infer the install path from the install.sh location, seems ergonomically better than a config. |
If we start to offer backup mirrors for the downloads, that could be a config as well.
Well there are use cases where someone wants to use a different download folder for the binaries than the location of the script, but yes I think using the script's directory would be a very reasonable default. |
A different path could easily be configured by symlinking ~/dlang to wherever you want. |
We can't do that without breaking changes.
Who knows how people depend on this?
Always updating the installer (#302) is something you requested yourself ;-) |
I really like the installer, but I would prefer if it would use a different directory by default.
This PR allows the installer script to read a configuration file and thus have permanent configuration settings. I know that I could write a small wrapper around the installer or simply patch it, but I believe that I am not the only one having this problem.
tl;dr: With this PR, one can define
~/.config/dlang/installer.cfg
and do sth. like:To use a different default directory.