summaryrefslogtreecommitdiffstats
path: root/bin/use-draft-css
blob: 5041ece8a08c7aa217a24c2cea3ea8ba3bf74a8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
########################################################################
# Tommy.Reynolds <Tommy.Reynolds@MegaCoder.com>
# 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