Skip to content

Commit

Permalink
on_startup: also pass a boolean dirty to detect --dirtyreload
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Sep 11, 2022
1 parent 4c7377c commit d2f910e
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 63 deletions.
2 changes: 1 addition & 1 deletion docs/img/plugin-events.py
Expand Up @@ -87,7 +87,7 @@ def placeholder_cluster(g, name):
node(c, f"placeholder_{name}", label="...", fillcolor="transparent", color="transparent")


event(graph, "on_startup", "command")
event(graph, "on_startup", "command dirty")

with cluster(graph, "cluster_build", bgcolor="#dddddd11") as g:
event(g, "on_config", "config")
Expand Down
112 changes: 57 additions & 55 deletions docs/img/plugin-events.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions mkdocs/__main__.py
Expand Up @@ -241,7 +241,7 @@ def build_command(clean, **kwargs):

_enable_warnings()
cfg = config.load_config(**kwargs)
cfg['plugins'].run_event('startup', command='build')
cfg['plugins'].run_event('startup', command='build', dirty=not clean)
try:
build.build(cfg, dirty=not clean)
finally:
Expand All @@ -268,7 +268,7 @@ def gh_deploy_command(

_enable_warnings()
cfg = config.load_config(remote_branch=remote_branch, remote_name=remote_name, **kwargs)
cfg['plugins'].run_event('startup', command='gh-deploy')
cfg['plugins'].run_event('startup', command='gh-deploy', dirty=not clean)
try:
build.build(cfg, dirty=not clean)
finally:
Expand Down

0 comments on commit d2f910e

Please sign in to comment.