websoft9/cli/stackhub.py

61 lines
1.3 KiB
Python
Raw Normal View History

2021-09-26 07:22:38 +00:00
#!/usr/bin/env python3
2021-09-27 09:32:10 +00:00
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, Union
2021-09-23 10:06:29 +00:00
import os, io, sys, platform, shutil, urllib3, json, time, subprocess
2021-09-26 09:57:34 +00:00
import model, controller
2021-09-23 10:06:29 +00:00
import typer
app = typer.Typer()
@app.command()
2021-09-26 09:57:34 +00:00
def list():
2021-09-26 07:22:38 +00:00
'''print the lists file'''
2021-09-26 09:57:34 +00:00
controller.Print.printRepo()
2021-09-26 15:05:59 +00:00
@app.command()
2021-09-27 09:32:10 +00:00
def create(app_name: str, project_name: Optional[str] = None):
'''create one application'''
create = controller.Create(app_name, project_name)
create.downRepo()
create.upRepo()
2021-09-28 10:34:18 +00:00
create.setEnv()
create.printResult()
@app.command()
def start(app_name: str, project_name: Optional[str] = None):
'''start one application'''
pass
2021-09-26 07:22:38 +00:00
@app.command()
def update(name: str):
'''update the local lists cache'''
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
2021-09-26 07:22:38 +00:00
@app.command()
def upgrade(name: str):
'''upgrade one application'''
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
2021-09-26 07:22:38 +00:00
@app.command()
def search(name: str):
'''Search application you want to install'''
2021-09-23 10:06:29 +00:00
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
2021-09-26 07:22:38 +00:00
@app.command()
def show(name: str):
'''show the detail of application'''
typer.echo(f"Hello {name}")
2021-09-26 09:57:34 +00:00
@app.command()
def package(name: str):
'''package one application for no network environment'''
typer.echo(f"Hello {name}")
2021-09-23 10:06:29 +00:00
if __name__ == "__main__":
2021-09-26 07:22:38 +00:00
app()