Commit 3ce82bf6 authored by Lorenz Steinert's avatar Lorenz Steinert

rewrote post-recive

parent c3cd0f6a
......@@ -4,6 +4,9 @@
import os
import shutil
import configparser
import subprocess
files = subprocess.check_output(['git', 'diff', '--name-only', 'HEAD@{1}', 'HEAD']).decode('utf-8').split('\n')
if 'proto.ini' not in os.listdir('.'):
shutil.copyfile('./proto.ini.default', './proto.ini')
......@@ -14,14 +17,15 @@ config.read('./proto.ini')
config_default = configparser.ConfigParser()
config_default.read('./proto.ini.default')
for i in config_default:
for j in config_default[i]:
try:
if j not in config[i]:
if 'proto.ini.default' in files:
for i in config_default:
for j in config_default[i]:
try:
if j not in config[i]:
shutil.copyfile('./proto.ini', './proto.ini.bak')
shutil.copyfile('./proto.ini.default', './proto.ini')
raise SystemExit(0)
except:
shutil.copyfile('./proto.ini', './proto.ini.bak')
shutil.copyfile('./proto.ini.default', './proto.ini')
raise SystemExit(0)
except:
shutil.copyfile('./proto.ini', './proto.ini.bak')
shutil.copyfile('./proto.ini.default', './proto.ini')
raise SystemExit(0)
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment