mirror of
https://github.com/Websoft9/websoft9.git
synced 2024-11-21 23:20:23 +00:00
gitclone
This commit is contained in:
parent
2c04627f8d
commit
65500eb06e
3 changed files with 21 additions and 6 deletions
|
@ -1,12 +1,26 @@
|
||||||
import model
|
import model, os
|
||||||
|
|
||||||
path_repo = "./data/application.list"
|
path_repo = "./data/application.list"
|
||||||
path_project = ""
|
path_project = ""
|
||||||
|
|
||||||
|
# for Git clone HA
|
||||||
|
github_url = ("https://github.com", "https://github.com.cnpmjs.org", "https://hub.fastgit.org")
|
||||||
|
|
||||||
class Print:
|
class Print:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def printRepo():
|
def printRepo():
|
||||||
model.FileOp.printJson(path_repo)
|
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)
|
|
@ -5,9 +5,6 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Type, U
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
import urllib.request
|
import urllib.request
|
||||||
|
|
||||||
# for Git clone HA
|
|
||||||
github_url = ("https://github.com", "https://github.com.cnpmjs.org", "https://hub.fastgit.org")
|
|
||||||
|
|
||||||
class SmoothUrl:
|
class SmoothUrl:
|
||||||
''' get url '''
|
''' get url '''
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,11 @@ app = typer.Typer()
|
||||||
def list():
|
def list():
|
||||||
'''print the lists file'''
|
'''print the lists file'''
|
||||||
controller.Print.printRepo()
|
controller.Print.printRepo()
|
||||||
|
|
||||||
|
@app.command()
|
||||||
|
def gitclone(name: str):
|
||||||
|
'''git clone'''
|
||||||
|
controller.Github.gitClone(name)
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def update(name: str):
|
def update(name: str):
|
||||||
|
|
Loading…
Reference in a new issue