packs
packs copied to clipboard
Initial pass at an `init` command
As discussed in #144 an init command might be nice.
This is probably the first time I have ever written any Rust so I just tried copying things I saw in the existing implementation and did some work arounds to compile errors using ChatGPT.
Ideally someone with some experience could help turn this into a proper solution that is more idiomatic etc!
I added the config file creation at a point before the configuration load happens to avoid it blowing up but Im sure there is a better solution here.
Anyway thought it might be a starting point!
Will do!
@alexevanczuk apologies for the delay on this, I will pick it up again asap
No rush @stevegeek ! Totally on your schedule here :)
@alexevanczuk made some changes to the way I had implemented this command. Think this implementation solves a few of the issues with the previous one. Added a test too
@alexevanczuk Thanks very much for the review. Will take a look now
Looks good, one thought that we should just create one YML file to start. I kind of like the idea of just creating the
packs.ymland referencingpkscommands instead of packwerk commands, since if someone is starting a new app for the first time it's a good time to start usingpksfrom the beginning, what do you think?
Makes sense to assume one would be using pks from the get go in this case. I will look at packs first mode, didnt even notice it before, have always used a packwerk.yml
Also you have a couple of lint errors but if you run
cargo fmt && cargo clippyit should show you where they are! There are some cmd line flags to auto fix too (you can have this set up in your editor to auto-fix lint errors).
Ok, yeah I saw there was a githook but it was blowing up and I couldn't work out how to get it to run so committed without it. will make sure to run the formatter next time!
Nice!! Just two very small changes requested:
- Can ya add that inline comment about why the case on the command is higher for init?
- Want to bump the patch version in
Cargo.toml? That will allow the new version to be auto-published when merged 🎉
@alexevanczuk thanks for the patient review. Hope those last changes are ok!
Thanks @alexevanczuk !