Only commit if there's something to do

This commit is contained in:
KoffeinFlummi 2015-05-08 19:37:14 +02:00
parent d96b8cedc5
commit 38b03e2b18

View File

@ -57,8 +57,12 @@ def deploy_documentation(token):
shutil.copyfile(os.path.join(root, name), os.path.join(target, name))
sp.check_call(["git", "add", "--all", "."])
sp.check_call(["git", "commit", "-m", "Automatic gh-pages deployment"])
sp.check_call(["git", "push", "origin", "gh-pages"], stdout=devnull, stderr=devnull)
filenum = sp.check_output(["git", "status", "--porcelain"])
filenum = len(str(filenum, "utf-8").split("\n")) - 1
if filenum > 0:
sp.check_call(["git", "commit", "-m", "Automatic gh-pages deployment"])
sp.check_call(["git", "push", "origin", "gh-pages"], stdout=devnull, stderr=devnull)
os.chdir("..")