From b6af6ce1dbb7ec2c746b0dc8dffb3395aded6cde Mon Sep 17 00:00:00 2001 From: Tommy Reynolds Date: Wed, 23 Nov 2005 06:40:25 +0000 Subject: Shell script to switch to the "DRAFT" CSS stylesheet in an HTML directory. --- bin/use-draft-css | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 bin/use-draft-css (limited to 'bin/use-draft-css') diff --git a/bin/use-draft-css b/bin/use-draft-css new file mode 100755 index 0000000..5041ece --- /dev/null +++ b/bin/use-draft-css @@ -0,0 +1,36 @@ +#!/bin/bash +######################################################################## +# Tommy.Reynolds +# International copyright secured (C) 2005, All rights reserved. +# This software is licensed under the GPL. +######################################################################## +# Do surgery on the *.html files to reference the draft CSS stylesheet +# +# Use like this: +# +# use-draft-css /path/to/docdir +# +######################################################################## +# You will need to manually copy "../css/fedora-draft.css" and +# "../images/watermark.png" into the HTML's top-level directory. +######################################################################## +USAGE="usage: $(basename $0) /path/to/docdir" +SILENT=yes +while getopts v c +do + case "${c}" in + v ) SILENT="";; + * ) echo "${USAGE}" >&2; exit 1;; + esac +done +shift $(expr ${OPTIND} - 1) +if [ $# -gt 1 ]; then + echo "${USAGE}" >&2 + exit 1 +fi +find ${1:-.} -iname '*.html' -print | +while read f; do + [ "${SILENT}" ] || echo ${f} + sed 's/href="fedora.css"/href="fedora-draft.css"/' ${f} >${f}.tmp + mv ${f}.tmp ${f} +done -- cgit