Repository: VTimofeenko/confluence_poster

Issue:
Handle no config by prompting to create one
Depends on #11 

Discussion:

Patch:
diff --git a/confluence_poster/main.py b/confluence_poster/main.py
index b76a172..3e26f22 100644
--- a/confluence_poster/main.py
+++ b/confluence_poster/main.py
@@ -497,7 +497,11 @@ def main(
         state.minor_edit = minor_edit
 
         typer.echo("Reading config")
-        confluence_config = load_config(config)
+        try:
+            confluence_config = load_config(config)
+        except FileNotFoundError as e:
+            typer.echo("Config file not found. Consider running `create-config`")
+            raise e
         state.config = confluence_config
 
         # Check that the parameters are not used with more than 1 page in the config


Test patch:
diff --git a/tests/test_main_params.py b/tests/test_main_params.py
index c69ce2b..9474ba5 100644
--- a/tests/test_main_params.py
+++ b/tests/test_main_params.py
@@ -39,6 +39,9 @@ def test_different_config(tmp_path, config_file):
         assert state.config.pages[0].page_title == new_page_name
     else:
         assert result.exit_code == 1
+        assert (
+            "create-config" in result.stdout
+        ), "User should be prompted to create config through wizard"
         assert type(result.exception) is FileNotFoundError