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

Add support for generating templates for multiple days #20

Conversation

MarcinParda
Copy link
Contributor

Problem

If someone (like me 😅) skip a day or more, then after break besides running npm run create there is need for copy pasting folders for skipped days.

Changes

  • Change script name from create-template.js to create-templates.js.
  • Now changed script generates template folders for all days, from first day of current month to current day of current month.
  • If no templates are created there is also a message, that there is no changes.

Potential improvements

  • Make script to create template folders only for specific dates (from 01.12.2023 to 25.12.2023). Now if we would run this script on 30.01.2024 it could create all 30 template folders given pattern: [01-30]-01-2024.

@psmyrdek
Copy link
Collaborator

psmyrdek commented Dec 6, 2023

I have some concerns about modifying working script to handle recreation of past days - maybe we could cover this as two specific workflows?

create-template.js stays unmodified, while npm run create:month would recreate all the folders between 1-24 Dec up to the date of launching the command?

In that way, people starting the project in January would have exact mapping of days (Dec 2023) to tasks, not being time-dependent. WDYT?

@MarcinParda
Copy link
Contributor Author

Now that I looked at it I'm thinking the same thing, but I'm not sure which script should be default.
Let's leave create-template.js as the default one, so as not to mix it up and not generate too much crap if someone starts it on an unfavorable date.

"create-template.js stays unmodified, while npm run create:month would recreate all the folders between 1-24 Dec up to the date of launching the command?"

Great idea, I will create another CR in few hours with these changes.

@MarcinParda MarcinParda closed this Dec 6, 2023
@przeprogramowani
Copy link
Owner

Thanks a lot!

@imalgrab
Copy link

imalgrab commented Dec 6, 2023

@przeprogramowani @MarcinParda
What about adding the createDay -- date script and extending the create-template.js file so it accepts that exact date from the command line and creates that exact day folder?

Running

> npm run createDay 2023-12-03

would create 2023-12-03 folder.

Not having the time to run the command at the exact same day makes you create everything manually, this would require you only to run one command and specify the date.

@MarcinParda
Copy link
Contributor Author

@imalgrab
From my perspective, it would be more convenient to just copy and paste the files instead of entering the day in the terminal.

But I can imagine that someone might find such a script useful 😄

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.

None yet

4 participants