websoft9/cli/stackhub.py

63 lines
1.3 KiB
Python
Raw Normal View History

2021-09-26 07:22:38 +00:00
#!/usr/bin/env python3
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()
def gitclone(name: str):
'''git clone'''
controller.Github.gitClone(name)
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
@app.command()
2021-09-26 07:22:38 +00:00
def install(name: str, formal: bool = False, type: str = None):
'''install one application'''
2021-09-23 10:06:29 +00:00
if formal:
typer.echo(f"Goodbye Ms. {name}. Have a good day.")
else:
typer.echo(f"Bye {name}!")
2021-09-26 07:22:38 +00:00
os.system("gh repo list websoft9 --public --no-archived")
2021-09-23 10:06:29 +00:00
if __name__ == "__main__":
2021-09-26 07:22:38 +00:00
app()