Skip to content

Commit

Permalink
Update invoke run to execute README usage
Browse files Browse the repository at this point in the history
  • Loading branch information
emersonmx committed Aug 16, 2022
1 parent 9a6ae69 commit f3a4d06
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,21 @@


@task
def run(c):
def run(_):
# type: (Context) -> None
c.run("python yaex.py")
from yaex import append, delete, go_to_first_line, move, search, yaex

with open("README.md") as f:
readme_data = f.read()

readme_code = yaex(
append(readme_data),
delete(),
search(r"```python").in_reverse(),
delete().from_range(go_to_first_line(), move(0)),
)

exec(readme_code) # nosec


@task(aliases=("fmt",))
Expand Down

0 comments on commit f3a4d06

Please sign in to comment.