mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-01-31 15:32:35 +00:00
separate chmod from context
This commit is contained in:
parent
4470c5abbd
commit
c0545b8777
@ -50,12 +50,12 @@ def writetrogglefile(filepath, filecontent):
|
|||||||
# do not trap exceptions, pass them up to the view that called this function
|
# 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.
|
# if the os.chmod fails, it can zero the contents of the file as a side effect. Dangerous.
|
||||||
with open(filepath, "w") as f:
|
with open(filepath, "w") as f:
|
||||||
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} ')
|
print(f'WRITING{cwd}---{filename} ')
|
||||||
call([git, "add", filename], cwd=cwd)
|
f.write(filecontent)
|
||||||
call([git, "commit", "-m", 'Online cave or entrance edit'], cwd=cwd)
|
#filepath.chmod(0o664) # set file permissions to rw-rw-r--
|
||||||
|
os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
|
||||||
|
call([git, "add", filename], cwd=cwd)
|
||||||
|
call([git, "commit", "-m", 'Online cave or entrance edit'], cwd=cwd)
|
||||||
|
|
||||||
|
|
||||||
class Area(TroggleModel):
|
class Area(TroggleModel):
|
||||||
|
Loading…
Reference in New Issue
Block a user