-
Notifications
You must be signed in to change notification settings - Fork 127
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
feat: template create automation #23
Conversation
Refined the create-template script to introduce additional automation with two new arguments: "all" and "with-previous". The "all" parameter facilitates the creation of folders for all tasks from the event's start to its end, streamlining the process. The "with-previous" parameter option enables the generation of missing tasks from the current date to the event's start date.
styles: fix whitespaces
scripts/create-template.js
Outdated
if (!fs.existsSync('tasks')) { | ||
fs.mkdirSync('tasks'); | ||
if (!arg) { | ||
createTaskFolder(new Date()); |
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.
As a follow-up, would be nice to reuse createTaskFoldersFromRange
with just one day. I do understand it requires more work, so only FYI, not a blocker.
package.json
Outdated
@@ -7,6 +7,8 @@ | |||
"license": "ISC", | |||
"scripts": { | |||
"create": "node ./scripts/create-template.js", | |||
"create-all": "node ./scripts/create-template.js all", |
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.
Let's use semicolons like with test:all
and create:all
if you don't mind.
README.md
Outdated
@@ -14,14 +14,22 @@ Zadania są dostępne na stronie [opanujfrontend.pl/advent](https://opanujfronte | |||
|
|||
Każdego dnia wykonaj w repozytorium polecenie `npm run create` a następnie skopiuj kod ze strony. | |||
|
|||
Użyj komendy `npm run create all`, jeśli chcesz wygenerować foldery z plikami startowymi |
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.
I think it's best to reference explicit names of npm scripts just to be consistent.
npm run create:month
as suggested by @MarcinParda
npm run create:?
- I can't find any single-word name for "up until today"
@kumiega Thank's a lot for this PR. Just to preserve original order of requests and proposals, I just merged |
Thanks for response. I will try to make changes today. |
It took some time, but I finally pushed the changes to the repo! |
We'll take a look today, many thanks :) |
@all-contributors please add @kumiega for code |
I've put up a pull request to add @kumiega! 🎉 |
* feat: improve create template script Refined the create-template script to introduce additional automation with two new arguments: "all" and "with-previous". The "all" parameter facilitates the creation of folders for all tasks from the event's start to its end, streamlining the process. The "with-previous" parameter option enables the generation of missing tasks from the current date to the event's start date. * feat: add new create-template scripts * docs: update README.md with new scripts styles: fix whitespaces --------- Co-authored-by: Przemek Smyrdek <przemek.smyrdek@gmail.com>
I have created a more advanced template automation inside create-template.js script. I added two extra script paths with parameters usage. The
all
parameter will create tasks for whole event andwith-previous
do it from relative "today" to the event start date.Also I have prepared the npm scripts for these parameters and updated the
README.md
docs.