diff options
Diffstat (limited to 'blog/post-receive')
| -rwxr-xr-x | blog/post-receive | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/blog/post-receive b/blog/post-receive index d5f26676..f69abaf6 100755 --- a/blog/post-receive +++ b/blog/post-receive @@ -8,7 +8,6 @@ import tempfile target_ref = "refs/heads/master" pushed_commit = None -uv = pathlib.Path.home() / ".local" / "bin" / "uv" dest = pathlib.Path.home() / "public_html" refs = sys.stdin.readlines() @@ -28,8 +27,9 @@ with tempfile.TemporaryDirectory() as tempdir: tempdir = pathlib.Path(tempdir) repo = tempdir / "repo" subprocess.run(["git", "worktree", "add", repo, pushed_commit], check=True) - blog = repo / "blog" - os.chdir(blog) - built = tempdir / "built" - subprocess.run([uv, "run", "blog", "build", blog, built], check=True) - subprocess.run(["rsync", "-r", "--delete-after", f"{built}/", f"{dest}/"], check=True) + try: + blog = repo / "blog" + os.environ["PATH"] = "/home/alex/.local/bin:" + os.environ["PATH"] + subprocess.run(["./build.sh", dest], check=True, cwd=blog) + finally: + subprocess.run(["git", "worktree", "remove", repo], check=True) |
