Get assignment instructions#
There are a set of commands that can be used to create the badge issues.
Get Assignment#
Example use case: making a badge issue
cspt getassignment | gh issue create -t 'next prepare work' -F -
The -F
option of gh issue create
allows specifying a file for the body of the issue, and -
reads from stdin, or in this case the pipe.
Create a badge issue for a specific date#
Create a badge issue from instructions
cspt getassignment --type practice --date 2024-02-15 | gh issue create -t 'practice 2024-02-15' -F -
Use instructions in PR issue#
Put badge instructions into the PR comment, while creating a PR from the current branch
cspt getassignment --type practice --date 2024-02-15 | gh pr create -t 'practice 2024-02-15' -F -
Details#
cspt getassignment#
get the assignment text formatted
cspt getassignment [OPTIONS]
Options
- --type <assignment_type>#
type can be {prepare, review, or practice}; default prepare
- --date <date>#
date should be YYYY-MM-DD of the tasks you want; default most recently posted
Get the most recent badge date#
To get the date of the most recently posted badge of a given type, for
example when creating issues for the title use cspt getbadgedate
pretitle="prepare-"$(cspt getbadgedate --prepare)
cspt getassignment --type prepare | gh issue create --title $pretitle --label prepare --body-file -
cspt getbadgedate#
cli for calculate badge date
cspt getbadgedate [OPTIONS]
Options
- --type <assignment_type>#
type can be prepare, review, or practice
- --prepare#
- --review#
- --practice#