Skip to content

Commit 125a39c

Browse files
committed
BLD: respect BUILDDIR in make publish-prepare
1 parent 58152b5 commit 125a39c

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

Diff for: Makefile

+14-16
Original file line numberDiff line numberDiff line change
@@ -200,24 +200,22 @@ GITLASTCOMMIT = $(shell git rev-parse --short HEAD)
200200
git branch --track $(PUBLISHBRANCH) origin/$(PUBLISHBRANCH)
201201

202202
publish-prepare: .create-publish-branch
203-
@test -d _build/html || \
203+
@test -d $(BUILDDIR)/html || \
204204
( echo >&2 "Run 'make html' first!"; false )
205-
test -d _build/webpage || \
206-
git clone -s -b $(PUBLISHBRANCH) $(GITREPOPATH) _build/webpage
207-
cd _build/webpage && \
208-
git fetch && \
209-
git checkout --force $(PUBLISHBRANCH)
210-
cd _build/webpage && \
211-
git pull $(GITREMOTEURL) $(PUBLISHBRANCH)
205+
test -d $(BUILDDIR)/webpage || \
206+
git clone -s -b $(PUBLISHBRANCH) $(GITREPOPATH) $(BUILDDIR)/webpage
207+
git -C $(BUILDDIR)/webpage fetch
208+
git -C $(BUILDDIR)/webpage checkout --force $(PUBLISHBRANCH)
209+
git -C $(BUILDDIR)/webpage pull $(GITREMOTEURL) $(PUBLISHBRANCH)
212210
rsync -aOcv --delete --exclude=.git --exclude=.rsync-exclude \
213-
--exclude-from=_build/webpage/.rsync-exclude \
214-
--link-dest=$(CURDIR)/_build/html _build/html/ _build/webpage/
215-
cd _build/webpage && \
216-
git add --force --all . && \
217-
git diff --cached --quiet || \
218-
git commit -m "Sync with the source at $(GITLASTCOMMIT)"
219-
cd _build/webpage && \
220-
git push $(GITREPOPATH) $(PUBLISHBRANCH)
211+
--exclude-from=$(BUILDDIR)/webpage/.rsync-exclude \
212+
--link-dest=$(realpath $(BUILDDIR)/html) \
213+
$(BUILDDIR)/html/ $(BUILDDIR)/webpage/
214+
git -C $(BUILDDIR)/webpage add --force --all .
215+
git -C $(BUILDDIR)/webpage diff --cached --quiet || \
216+
git -C $(BUILDDIR)/webpage \
217+
commit -m "Sync with the source at $(GITLASTCOMMIT)"
218+
git -C $(BUILDDIR)/webpage push $(GITREPOPATH) $(PUBLISHBRANCH)
221219

222220
publish-push:
223221
git push $(GITREMOTE) $(SOURCEBRANCH) $(PUBLISHBRANCH)

0 commit comments

Comments
 (0)