fix: pass MOVIES_DIR env to build_catalog.sh
This commit is contained in:
1 parent
e0bfb2e8ed
commit
a36058cab9
1 file changed
+2
-1
@@ -101,9 +101,10 @@ def rebuild_catalog():
|
||||
script = MOVIES_DIR.parent / "build_catalog.sh"
|
||||
if not script.exists():
|
||||
raise HTTPException(500, "build_catalog.sh not found at %s" % script)
|
||||
env = dict(os.environ, MOVIES_DIR=str(MOVIES_DIR))
|
||||
try:
|
||||
subprocess.run(["bash", str(script)], check=True,
|
||||
capture_output=True, text=True, timeout=120)
|
||||
capture_output=True, text=True, timeout=120, env=env)
|
||||
except subprocess.CalledProcessError as e:
|
||||
raise HTTPException(500, "build failed: " + (e.stderr or e.stdout or str(e)))
|
||||
cat = load_catalog()
|
||||
|
||||
Reference in new issue
Block a user