mirror of
https://github.com/dtomlinson91/tembo.git
synced 2025-12-22 13:45:45 +00:00
add command not found error
This commit is contained in:
11
tembo/cli.py
11
tembo/cli.py
@@ -32,6 +32,8 @@ def new(scope, inputs, dry_run):
|
|||||||
|
|
||||||
Example: tembo new meeting my_presentation
|
Example: tembo new meeting my_presentation
|
||||||
"""
|
"""
|
||||||
|
_name_found = scope in [user_scope["name"] for user_scope in tembo.CONFIG.scopes]
|
||||||
|
if _name_found:
|
||||||
for user_scope in tembo.CONFIG.scopes:
|
for user_scope in tembo.CONFIG.scopes:
|
||||||
if user_scope["name"] == scope:
|
if user_scope["name"] == scope:
|
||||||
scoped_page = pages.ScopedPageCreator().create_page(
|
scoped_page = pages.ScopedPageCreator().create_page(
|
||||||
@@ -41,11 +43,14 @@ def new(scope, inputs, dry_run):
|
|||||||
extension=str(user_scope["extension"]),
|
extension=str(user_scope["extension"]),
|
||||||
name=str(user_scope["name"]),
|
name=str(user_scope["name"]),
|
||||||
user_input=inputs,
|
user_input=inputs,
|
||||||
template_filename=str(user_scope["template_filename"]),
|
template_filename=str(user_scope["template_filename"])
|
||||||
)
|
)
|
||||||
scoped_page.save_to_disk(dry_run=dry_run)
|
scoped_page.save_to_disk(dry_run=dry_run)
|
||||||
tembo.logger.info("Saved %s to disk", scoped_page.path)
|
tembo.logger.info("Saved %s to disk", scoped_page.path)
|
||||||
raise SystemExit(0)
|
raise SystemExit(0)
|
||||||
|
if not _name_found and len(tembo.CONFIG.scopes) > 0:
|
||||||
|
tembo.logger.warning("Command %s not found in config.yml - exiting", scope)
|
||||||
|
raise SystemExit(0)
|
||||||
tembo.logger.critical(
|
tembo.logger.critical(
|
||||||
"No config.yml found in %s - exiting", tembo.CONFIG.config_path
|
"No config.yml found in %s - exiting", tembo.CONFIG.config_path
|
||||||
)
|
)
|
||||||
@@ -56,4 +61,6 @@ run.add_command(new)
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
new(["scratchpad"], ())
|
# BUG: fix this bug where input tokens are mismatched
|
||||||
|
new(["meeting", "robs presentation", "meeting on gcp"])
|
||||||
|
# new(["meeting", "robs presentation"])
|
||||||
|
|||||||
Reference in New Issue
Block a user