Skip to content

Commit

Permalink
feat(hyfi): refactor copy command to use Copier class
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jun 15, 2023
1 parent 2608ee4 commit 484835c
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/hyfi/__click__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

from hyfi._version import __version__
from hyfi.env import HyfiConfig
from hyfi.main import _about, getLogger
from hyfi.hydra import __hyfi_path__
from hyfi.main import _about
from hyfi.utils.copier import Copier
from hyfi.utils.logging import getLogger

logger = getLogger(__name__)

Expand All @@ -16,19 +19,25 @@ def cli():


@cli.command()
@click.option("--src_path", default="conf", help="Source path to copy from")
@click.option("--dst_path", default=".", help="Destination path to copy to")
@click.option(
"--src_path", default=f"{__hyfi_path__()}/conf", help="Source path to copy from"
)
@click.option(
"--dst_path", show_default=True, default="conf", help="Destination path to copy to"
)
@click.option("--exclude", default=None, help="Exclude files matching this pattern")
@click.option("--skip_if_exists", default=False, help="Skip if destination exists")
@click.option("--overwrite", default=False, help="Overwrite destination")
@click.option("--dry_run", default=False, help="Dry run")
@click.option("--verbose", default=False, help="Verbose output")
@click.option("--verbose", is_flag=True, default=False, help="Verbose output")
def cc(**args):
"""
Copy all config files to the destination directory.
"""
click.echo("Copying configuration files")
click.echo(f"args : {args}")
# click.echo(f"args : {args}")
with Copier(**args) as worker:
worker.run_copy()


@cli.command()
Expand Down

0 comments on commit 484835c

Please sign in to comment.