diff --git a/cli/controller.py b/cli/controller.py index 532fe10d..fa185445 100644 --- a/cli/controller.py +++ b/cli/controller.py @@ -1,12 +1,26 @@ -import model +import model, os path_repo = "./data/application.list" path_project = "" +# for Git clone HA +github_url = ("https://github.com", "https://github.com.cnpmjs.org", "https://hub.fastgit.org") + class Print: def __init__(self): pass def printRepo(): - model.FileOp.printJson(path_repo) \ No newline at end of file + model.FileOp.printJson(path_repo) + + +class Github: + + def __init__(self): + pass + + def gitClone(name: str): + cmd = "git clone --depth=1 " + model.SmoothUrl.res(github_url) + "/websoft9/docker-" + name + " repo/docker-"+name + print(cmd) + os.system(cmd) \ No newline at end of file diff --git a/cli/model.py b/cli/model.py index 46881b6b..9d5d2e60 100644 --- a/cli/model.py +++ b/cli/model.py @@ -5,9 +5,6 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, U import urllib.parse import urllib.request -# for Git clone HA -github_url = ("https://github.com", "https://github.com.cnpmjs.org", "https://hub.fastgit.org") - class SmoothUrl: ''' get url ''' diff --git a/cli/stackhub.py b/cli/stackhub.py index a07d1a3e..f98747a1 100644 --- a/cli/stackhub.py +++ b/cli/stackhub.py @@ -12,7 +12,11 @@ app = typer.Typer() def list(): '''print the lists file''' controller.Print.printRepo() - + +@app.command() +def gitclone(name: str): + '''git clone''' + controller.Github.gitClone(name) @app.command() def update(name: str):