Allow testsite to link current to its own issue number

This commit is contained in:
Solene Rapenne 2021-09-29 13:16:12 +02:00
parent 61e664ee56
commit 4c907680fb
2 changed files with 21 additions and 8 deletions

View File

@ -1,16 +1,22 @@
generate-site:
TEMPDIR=/tmp/openbsd-webzine/
generate-site: clean
ls | grep issue- | sort -n | xargs ./make_issue.sh
./make_issue.sh _index ../public/index.html
all: generate-site
clean:
rm ../dev/*html
rm -f ../dev/*html ../public/*
test:
./make_issue.sh current /tmp/current-issue.html
xdg-open /tmp/current-issue.html
mkdir -p ${TEMPDIR}
./make_issue.sh current ${TEMPDIR}/current-issue.html
xdg-open ${TEMPDIR}/current-issue.html
testsite: generate-site
cp -fr ../public /tmp/
xdg-open /tmp/public/index.html
testsite: clean
ls | grep issue- | sort -n | xargs ./make_issue.sh -t
./make_issue.sh _index ../public/index.html
mkdir -p ${TEMPDIR}
cp -fr ../public ${TEMPDIR}/
xdg-open ${TEMPDIR}/public/index.html

View File

@ -10,6 +10,13 @@ die() {
exit 1
}
testsite=0
if [ "$1" = "-t" ]
then
testsite=1
shift
fi
DIR=$(basename $1)
DESTFILENAME=$2
CURINODE=$(stat -f "%i" current/)
@ -18,7 +25,7 @@ test -d "$DIR" || usage
test -d ../public/ || die "You must run this from openbsd-webzine/current"
ls $DIR/*.html 2>&1 >/dev/null || die "no html file in $DIR"
if [ "$(stat -f '%i' $DIR)" -eq "$CURINODE" ]
if [ $testsite -eq 0 ] && [ "$(stat -f '%i' $DIR)" -eq "$CURINODE" ]
then
DEST=dev
else