2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 14:17:09 +00:00

add git commit to file saving in 3 places

This commit is contained in:
Philip Sargent
2021-12-30 19:07:17 +00:00
parent 26454bf6c6
commit d1e6125d15
2 changed files with 35 additions and 20 deletions

View File

@@ -312,8 +312,9 @@ def editexpopage(request, path):
git = settings.GIT
try:
with open(filepath, "w") as f:
os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
f.write(result)
#print(f'WROTE {cwd}---{filename} ')
print(f'WRITING{cwd}---{filename} ')
subprocess.call([git, "add", filename], cwd=cwd)
subprocess.call([git, "commit", "-m", 'Edit this page'], cwd=cwd)
except PermissionError: