-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add current version to the generated config without hard coding it in the actual template. #73
Comments
Another option would be to use the It would require to either move the config from a separate variable inside the |
Would this not still mean we generate the template at compile time, or am I misunderstanding this? Edit: Did you mean using this environment variable instead of parsing the
Agreed. |
Yes, I did mean using the environment variable. As I understand, it's passed by I think I'd like to move towards the direction of generating the default configuration. A few things that come to my mind:
|
Should we also put the actual definitions of these in a config.toml as well so the tools can be edited without changing the code? This way others can also just fork and edit the config and build from source themselves much easier. Edit: formatting |
Interesting question 🤔 My first thought is to not put the details inside the config about each hardcoded tool to have a smaller default config and show that people don't need to uncomment all these details. Having a single example of a fully-detailed tool (not hardcoded by When you want to fork a project and get binaries from your own fork, you only need to change the People can always delete redundant comments but my gut feeling is that people will rarely have customized forks and more often they would just want a list of tools to download. So I'm proposing to optimize for the most common use case. Of course, time will show and we can always change the defaults later if we realise this is not the case 🙂 |
Ye good point, I thought this might have been easier to maintain as well since it would just be a change in the config and rebuild. |
This pr adds a `.pre-commit-config.yaml` to the repo so others can install a [pre-commit](https://pre-commit.com/). The options added are in the suggested list of the pre-commit project.
…ersion (#78) Resolves #73 This adds a build script that generates the `src/config/template.rs` file. It is done this way because there is no access to version information after compile time. It uses the `CARGO_PKG_VERSION` environment variable made available for cargo after running the command `cargo build`. ### Additional tasks tasks following #73 --- - [x] Automatically embedding version. As discussed in this issue. - [x] Prefill all the tools supported by tool-sync. This requires converting the big match to a BTreeMap. - [x] Add comments around tool tables. To make sure that the code inside the comments stays up-to-date and is parsed by tool-sync itself. General tasks --- - [ ] Documentation for changes provided/changed - [x] Tests added Co-authored-by: Dmitrii Kovanikov <kovanikov@gmail.com>
Referencing #62
Im not quite sure if a
build.rs
is the best way to implement this since this means we have to have a template for thesrc/config/template.rs
file itself. This sounds like a very weird approach to me but I currently don't see any other way to do this.The
build.rs
file would look something likeThe text was updated successfully, but these errors were encountered: