@@ -200,24 +200,22 @@ GITLASTCOMMIT = $(shell git rev-parse --short HEAD)
200
200
git branch --track $(PUBLISHBRANCH ) origin/$(PUBLISHBRANCH )
201
201
202
202
publish-prepare : .create-publish-branch
203
- @test -d _build /html || \
203
+ @test -d $( BUILDDIR ) /html || \
204
204
( 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 )
212
210
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 )
221
219
222
220
publish-push :
223
221
git push $(GITREMOTE ) $(SOURCEBRANCH ) $(PUBLISHBRANCH )
0 commit comments