Compare commits
2 commits
8d87c063cd
...
1b4daa0d71
Author | SHA1 | Date | |
---|---|---|---|
1b4daa0d71 | |||
1f28369805 |
2 changed files with 16 additions and 3 deletions
12
build.sh
12
build.sh
|
@ -3,6 +3,16 @@ pip install -r requirements.txt --target="$DIR"
|
||||||
|
|
||||||
cp -r nginx_configurator "$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"
|
rm -r "$DIR"
|
||||||
|
|
|
@ -252,8 +252,11 @@ def new(ctx):
|
||||||
ctx.invoke(reload)
|
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()
|
@cli.command()
|
||||||
@click.argument("service")
|
@click.argument("service", shell_complete=shell_complete_service)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def edit(ctx, service: str):
|
def edit(ctx, service: str):
|
||||||
"""Edit a service"""
|
"""Edit a service"""
|
||||||
|
@ -287,7 +290,7 @@ def edit(ctx, service: str):
|
||||||
|
|
||||||
|
|
||||||
@cli.command()
|
@cli.command()
|
||||||
@click.argument("service")
|
@click.argument("service", shell_complete=shell_complete_service)
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def delete(ctx, service: str):
|
def delete(ctx, service: str):
|
||||||
"""Delete a service"""
|
"""Delete a service"""
|
||||||
|
|
Loading…
Reference in a new issue