2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 16:51:54 +00:00

chmod after write

This commit is contained in:
Philip Sargent 2021-12-30 20:08:24 +00:00
parent c3a54858d5
commit 4470c5abbd

View File

@ -50,9 +50,9 @@ def writetrogglefile(filepath, filecontent):
# do not trap exceptions, pass them up to the view that called this function
# if the os.chmod fails, it can zero the contents of the file as a side effect. Dangerous.
with open(filepath, "w") as f:
f.chmod(0o664) # safely set file permissions to rw-rw-r--
# os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
f.write(filecontent)
filepath.chmod(0o664) # set file permissions to rw-rw-r--
# os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
print(f'WRITING{cwd}---{filename} ')
call([git, "add", filename], cwd=cwd)
call([git, "commit", "-m", 'Online cave or entrance edit'], cwd=cwd)