mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 10:37:07 +00:00
Make .3d files in same dir as .svx
This commit is contained in:
@@ -3,7 +3,8 @@ import os
|
||||
import datetime
|
||||
import re
|
||||
import json
|
||||
from subprocess import call
|
||||
import subprocess
|
||||
|
||||
from collections import defaultdict
|
||||
from pathlib import Path
|
||||
|
||||
@@ -56,8 +57,15 @@ def writetrogglefile(filepath, filecontent):
|
||||
f.write(filecontent)
|
||||
#os.chmod(filepath, 0o664) # set file permissions to rw-rw-r--
|
||||
# should replace .call with .run and capture_output=True
|
||||
call([git, "add", filename], cwd=cwd)
|
||||
call([git, "commit", "-m", f'Troggle online: cave or entrance edit -{filename}'], cwd=cwd)
|
||||
sp = subprocess.run([git, "add", filename], cwd=cwd, capture_output=True, check=True, text=True)
|
||||
if sp.returncode != 0:
|
||||
print(f'git ADD {cwd}:\n\n' + str(sp.stderr) + '\n\n' + str(sp.stdout) + '\n\nreturn code: ' + str(sp.returncode))
|
||||
|
||||
sp = subprocess.run([git, "commit", "-m", f'Troggle online: cave or entrance edit -{filename}'], cwd=cwd, capture_output=True, check=True, text=True)
|
||||
if sp.returncode != 0:
|
||||
print(f'git COMMIT {cwd}:\n\n' + str(sp.stderr) + '\n\n' + str(sp.stdout) + '\n\nreturn code: ' + str(sp.returncode))
|
||||
# not catching and re-raising any exceptions yet, inc. the stderr etc.,. We should do that.
|
||||
|
||||
|
||||
|
||||
class Area(TroggleModel):
|
||||
|
||||
Reference in New Issue
Block a user