From beebfdcaaa81502ce2c0be7b1cdc3591d4721147 Mon Sep 17 00:00:00 2001 From: Young Joon Lee Date: Fri, 16 Jun 2023 19:40:08 +0900 Subject: [PATCH] fix(cli): handle case when no copier configuration is found. --- src/hyfi/__cli__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/hyfi/__cli__.py b/src/hyfi/__cli__.py index f4145679..de01f550 100644 --- a/src/hyfi/__cli__.py +++ b/src/hyfi/__cli__.py @@ -41,8 +41,10 @@ def run_copy(**args): Copy all config files to the current working directory. This is a wrapper around HyfiConfig to allow us to pass arguments to it. """ - cfg = HyfiConfig(**args) - cfg = HyFI.to_dict(cfg.copier) + if "copier" not in args: + raise ValueError("No copier configuration found") + cfg = HyFI.to_dict(args["copier"]) + print(type(cfg), cfg) with Copier(**cfg) as worker: worker.run_copy()