Compare commits

...

2 commits

Author SHA1 Message Date
1b4daa0d71
add shell complete 2023-11-04 23:34:10 +01:00
1f28369805
do not build zipapps because theyre slow 2023-11-04 23:33:41 +01:00
2 changed files with 16 additions and 3 deletions

View file

@ -3,6 +3,16 @@ pip install -r requirements.txt --target="$DIR"
cp -r nginx_configurator "$DIR"
python3 -m zipapp -p "/bin/python3" -m "nginx_configurator.main:cli" -o ncc "$DIR"
#python3 -m zipapp -p "/bin/python3" -m "nginx_configurator.main:cli" -o ncc "$DIR"
# create entrypoint
cat > "$DIR/ncc" <<EOF
#!/bin/python3
from nginx_configurator import main
main.cli()
EOF
chmod +x "$DIR/ncc"
tar -cf ncc.tar -C "$DIR" .
rm -r "$DIR"

View file

@ -252,8 +252,11 @@ def new(ctx):
ctx.invoke(reload)
def shell_complete_service(ctx, param, incomplete):
return [file.name for file in certs.get_site_files(NGINX_DIR) if incomplete in file.name]
@cli.command()
@click.argument("service")
@click.argument("service", shell_complete=shell_complete_service)
@click.pass_context
def edit(ctx, service: str):
"""Edit a service"""
@ -287,7 +290,7 @@ def edit(ctx, service: str):
@cli.command()
@click.argument("service")
@click.argument("service", shell_complete=shell_complete_service)
@click.pass_context
def delete(ctx, service: str):
"""Delete a service"""