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
|
||||
./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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue