add command not found error

This commit is contained in:
2021-10-24 06:01:39 +01:00
parent 70129585a8
commit c85a006810

View File

@@ -32,20 +32,25 @@ def new(scope, inputs, dry_run):
Example: tembo new meeting my_presentation Example: tembo new meeting my_presentation
""" """
for user_scope in tembo.CONFIG.scopes: _name_found = scope in [user_scope["name"] for user_scope in tembo.CONFIG.scopes]
if user_scope["name"] == scope: if _name_found:
scoped_page = pages.ScopedPageCreator().create_page( for user_scope in tembo.CONFIG.scopes:
base_path=str(tembo.CONFIG.base_path), if user_scope["name"] == scope:
page_path=str(user_scope["path"]), scoped_page = pages.ScopedPageCreator().create_page(
filename=str(user_scope["filename"]), base_path=str(tembo.CONFIG.base_path),
extension=str(user_scope["extension"]), page_path=str(user_scope["path"]),
name=str(user_scope["name"]), filename=str(user_scope["filename"]),
user_input=inputs, extension=str(user_scope["extension"]),
template_filename=str(user_scope["template_filename"]), name=str(user_scope["name"]),
) user_input=inputs,
scoped_page.save_to_disk(dry_run=dry_run) template_filename=str(user_scope["template_filename"])
tembo.logger.info("Saved %s to disk", scoped_page.path) )
raise SystemExit(0) scoped_page.save_to_disk(dry_run=dry_run)
tembo.logger.info("Saved %s to disk", scoped_page.path)
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"])