如果本地存储库中不存在文件夹,则克隆-Python flask

时间:2019-12-22 11:41:02

标签: python git

我已经编写了使用Python Flask克隆存储库的代码。

from flask import Flask, render_template
app=Flask(__name__)
from git.repo.base import Repo
@app.route('/')
def index():
#here i have to write the code to check if the "FolderToSave" already exists! If it doesn't then only clone

Repo.clone_from("https://github.com/***", "FoldertToSave")
return render_template("index.html")
if __name__=='__main__':
   app.run(debug=True)

git中是否有任何方法可以检查本地存储库中是否已经存在克隆?

0 个答案:

没有答案