Allow testsite to link current to its own issue number
This commit is contained in:
parent
61e664ee56
commit
4c907680fb
|
@ -1,16 +1,22 @@
|
||||||
generate-site:
|
TEMPDIR=/tmp/openbsd-webzine/
|
||||||
|
|
||||||
|
generate-site: clean
|
||||||
ls | grep issue- | sort -n | xargs ./make_issue.sh
|
ls | grep issue- | sort -n | xargs ./make_issue.sh
|
||||||
./make_issue.sh _index ../public/index.html
|
./make_issue.sh _index ../public/index.html
|
||||||
|
|
||||||
all: generate-site
|
all: generate-site
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm ../dev/*html
|
rm -f ../dev/*html ../public/*
|
||||||
|
|
||||||
test:
|
test:
|
||||||
./make_issue.sh current /tmp/current-issue.html
|
mkdir -p ${TEMPDIR}
|
||||||
xdg-open /tmp/current-issue.html
|
./make_issue.sh current ${TEMPDIR}/current-issue.html
|
||||||
|
xdg-open ${TEMPDIR}/current-issue.html
|
||||||
|
|
||||||
testsite: generate-site
|
testsite: clean
|
||||||
cp -fr ../public /tmp/
|
ls | grep issue- | sort -n | xargs ./make_issue.sh -t
|
||||||
xdg-open /tmp/public/index.html
|
./make_issue.sh _index ../public/index.html
|
||||||
|
mkdir -p ${TEMPDIR}
|
||||||
|
cp -fr ../public ${TEMPDIR}/
|
||||||
|
xdg-open ${TEMPDIR}/public/index.html
|
||||||
|
|
|
@ -10,6 +10,13 @@ die() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
testsite=0
|
||||||
|
if [ "$1" = "-t" ]
|
||||||
|
then
|
||||||
|
testsite=1
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
DIR=$(basename $1)
|
DIR=$(basename $1)
|
||||||
DESTFILENAME=$2
|
DESTFILENAME=$2
|
||||||
CURINODE=$(stat -f "%i" current/)
|
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"
|
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"
|
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
|
then
|
||||||
DEST=dev
|
DEST=dev
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue