Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
fix missing cirrus-geo dep
Browse files Browse the repository at this point in the history
  • Loading branch information
jkeifer committed May 31, 2022
1 parent 337e734 commit b223614
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
cirrus-geo~=0.6.0
sphinx~=4.4
myst_parser~=0.17.0
sphinxcontrib-mermaid~=0.7.1
Expand Down
9 changes: 6 additions & 3 deletions src/cirrus/plugins/docs/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ def clean(output_dir, staging_dir):
'''
Remove all files from staging and build directories.
'''
from cirrus.core.utils.misc import clean_dir
clean_dir(output_dir)
clean_dir(staging_dir)
# TODO: once clean_dir is in a cirrus release update the
# required cirrus-geo version and replace the it here with
# the one imported from cirrus-geo and clean up in utils
#from cirrus.core.utils.misc import clean_dir
utils.clean_dir(output_dir)
utils.clean_dir(staging_dir)


@docs.command()
Expand Down
13 changes: 13 additions & 0 deletions src/cirrus/plugins/docs/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
from cirrus.core.project import Project


def clean_dir(directory: Path) -> None:
import shutil

if not directory.is_dir():
return

for f in directory.iterdir():
if not f.is_symlink() and f.is_dir():
shutil.rmtree(f)
else:
f.unlink()


class OptionProjectDefault(click.Option):
def get_default(self, ctx, call=False):
# we always want to resolve a value, for help messages,
Expand Down

0 comments on commit b223614

Please # to comment.