Skip to content

Commit

Permalink
fix: workflow for app build
Browse files Browse the repository at this point in the history
  • Loading branch information
kraanzu committed Feb 26, 2024
1 parent a1f6df7 commit 2cad495
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Package app with pyinstaller
run: |
python -c "with open('smassh.py', 'w') as f: f.write('from smassh.__main__ import main\nmain()\n')"
python -c "with open('smassh.py', 'w') as f: f.write('from smassh.__init__ import main\nmain()\n')"
pyinstaller -F smassh.py --add-data="smassh/ui/css/:smassh/ui/css"
# Setup File name
Expand Down
34 changes: 34 additions & 0 deletions smassh/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import click
from smassh.src.plugins.add_language import AddLanguage
from smassh.ui.tui import Smassh

PKG_VERSION = "3.1.0"


@click.group(
context_settings={"help_option_names": ["-h", "--help"]},
invoke_without_command=True,
)
@click.option(
"--version",
"-v",
is_flag=True,
help="Show version and exit.",
)
@click.pass_context
def main(ctx, version: bool) -> None:
if version:
return print(f"smassh - v{PKG_VERSION}")

if ctx.invoked_subcommand is None:
Smassh().run()


@main.command(help="Add a language to smassh")
@click.argument("name")
def add(name: str) -> None:
AddLanguage().add(name)


if __name__ == "__main__":
main()

0 comments on commit 2cad495

Please sign in to comment.