Skip to content

Commit

Permalink
fix: supports uvx
Browse files Browse the repository at this point in the history
  • Loading branch information
HYP3R00T committed Nov 25, 2024
1 parent 7e8f5cc commit 6bc63bb
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions omnishare/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

@app.command()
def main(
file: Annotated[str, typer.Argument(help="Provide markdown file")],
add_token: Annotated[bool | None, typer.Option(help="Add API token")] = False,
config: Annotated[bool | None, typer.Option(help="Configure the tool")] = False,
reset: Annotated[bool | None, typer.Option(help="Warning: Remove all saved tokens")] = False,
file: Annotated[str, typer.Argument(help="Provide markdown file")] = None,
add_token: Annotated[bool, typer.Option(help="Add API token")] = False,
config: Annotated[bool, typer.Option(help="Configure the tool")] = False,
reset: Annotated[bool, typer.Option(help="Warning: Remove all saved tokens")] = False,
):
# Greeter
console: Console = Console()
Expand Down Expand Up @@ -49,9 +49,12 @@ def main(
# TODO: Add handler
pass

post: Post = process_file(file)
linkedin_post(markdown_to_plain(post.content))
mastodon_post(markdown_to_plain(post.content))
if file:
post: Post = process_file(file)
linkedin_post(markdown_to_plain(post.content))
mastodon_post(markdown_to_plain(post.content))
elif not (add_token or config or reset):
raise typer.BadParameter("No file provided")


if __name__ == "__main__":
Expand Down

0 comments on commit 6bc63bb

Please sign in to comment.