forked from expo/troggle
fixed many problems in creating new entrances
This commit is contained in:
@@ -152,6 +152,8 @@ def write_and_commit(files, message):
|
||||
# GIT see also core/views/uploads.py dwgupload()
|
||||
# GIT see also core/views/expo.py editexpopage()
|
||||
os.makedirs(os.path.dirname(filepath), exist_ok = True)
|
||||
if filepath.is_dir():
|
||||
return False
|
||||
if encoding:
|
||||
mode = "w"
|
||||
kwargs = {"encoding": encoding}
|
||||
@@ -160,7 +162,7 @@ def write_and_commit(files, message):
|
||||
kwargs = {}
|
||||
try:
|
||||
with open(filepath, mode, **kwargs) as f:
|
||||
print(f"WRITING {cwd}---{filename} ")
|
||||
print(f"WRITING {cwd}/{filename} ")
|
||||
f.write(content)
|
||||
except PermissionError:
|
||||
raise WriteAndCommitError(
|
||||
@@ -226,6 +228,7 @@ def write_and_commit(files, message):
|
||||
raise WriteAndCommitError(
|
||||
f"CANNOT git on server for this file {filename}. Subprocess error. Edits not saved.\nAsk a nerd to fix this."
|
||||
)
|
||||
return True
|
||||
|
||||
|
||||
class WriteAndCommitError(Exception):
|
||||
|
||||
Reference in New Issue
Block a user