Skip to content

Commit

Permalink
refactor: using tasks directory instead of jobs
Browse files Browse the repository at this point in the history
tasks directory in the cookie-cutter is called "jobs", but everywhere is "tasks".
This will fix the inconsistency.
  • Loading branch information
CodeWithEmad committed Nov 6, 2023
1 parent ec442e8 commit 5ef6ec7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ generate-plugin-for-tests: ## Generate a plugin using the cookiecutter defaults
# The cookiecutter has many example code blocks prefixed with '### '.
# To help ensure that the example code would work if the user uncommented it,
# we remove the all '### ' occurances before running tests.
sed -i 's/### //' tutor-contrib-myplugin/tutormyplugin/plugin.py
sed -i 's/### //' tutor-contrib-myplugin/tutormyplugin/plugin.py
# We must also create this init task template, which the cookiecutter
# doesn't generate because its usage in plugin.py is commented out.
touch tutor-contrib-myplugin/tutormyplugin/templates/myplugin/jobs/init/lms.sh
touch tutor-contrib-myplugin/tutormyplugin/templates/myplugin/tasks/lms/init.sh
@echo "$(MSG)Plugin generated.$(END_MSG)"

test-plugin: test-plugin-quality test-plugin-install ## Test the default plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@
########################################

# To add a custom initialization task, create a bash script template under:
# {{ cookiecutter.module_name }}/templates/{{ cookiecutter.plugin_name }}/jobs/init/
# {{ cookiecutter.module_name }}/templates/{{ cookiecutter.plugin_name }}/tasks/
# and then add it to the MY_INIT_TASKS list. Each task is in the format:
# ("<service>", ("<path>", "<to>", "<script>", "<template>"))
MY_INIT_TASKS: list[tuple[str, tuple[str, ...]]] = [
# For example, to add LMS initialization steps, you could add the script template at:
# {{ cookiecutter.module_name }}/templates/{{ cookiecutter.plugin_name }}/jobs/init/lms.sh
# {{ cookiecutter.module_name }}/templates/{{ cookiecutter.plugin_name }}/tasks/lms/init.sh
# And then add the line:
### ("lms", ("{{ cookiecutter.plugin_name }}", "jobs", "init", "lms.sh")),
### ("lms", ("{{ cookiecutter.plugin_name }}", "tasks", "lms", "init.sh")),
]


Expand Down

0 comments on commit 5ef6ec7

Please sign in to comment.