Skip to content
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

Refactor template #59

Merged
merged 7 commits into from
Dec 10, 2023
Merged

Refactor template #59

merged 7 commits into from
Dec 10, 2023

Conversation

seblyng
Copy link
Owner

@seblyng seblyng commented Dec 10, 2023

This adds a couple of changes.

First, it changes the template to remove the bin and src folder. Instead it appends to Cargo.toml on the path to the binaries for the respective days. It might be controversial to remove the src folder. I am not sure if I want to do that or not, but I at least want to remove the bin folder.

I also added a check to make sure that we don't override a project if it already exists.

There is also one breaking change here. Removal of the year argument to run. However, I think calculating it from the directory is better, as it may lead to less undefined behaviour. Currently, if I have a folder year_2020, and I run cargo aoc run -d 1 inside that folder, it will run the correct day from that year. However, since I forgot to add the year flag, it will actually download the input file from 2023 (current year)!. This changes that behaviour to correctly parese the folder name to download the correct input

src/setup.rs Show resolved Hide resolved
@seblyng seblyng requested a review from sivertjoe December 10, 2023 15:07
Copy link
Collaborator

@sivertjoe sivertjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👑

@seblyng seblyng merged commit 56c9859 into master Dec 10, 2023
1 check passed
@seblyng seblyng deleted the refactor_template branch December 10, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants