summaryrefslogtreecommitdiff
path: root/fetch-css.sh
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-06-17 11:12:50 -0400
committerB Stack <bgstack15@gmail.com>2020-06-17 11:12:50 -0400
commitaca4666d7191e582903ca0ad47a46a59b0fa0a89 (patch)
tree6abf882870b0d261206ce2df2f65a5eca3ae990b /fetch-css.sh
parentadd minor fixes and major image fixes (diff)
downloadglip-aca4666d7191e582903ca0ad47a46a59b0fa0a89.tar.gz
glip-aca4666d7191e582903ca0ad47a46a59b0fa0a89.tar.bz2
glip-aca4666d7191e582903ca0ad47a46a59b0fa0a89.zip
fix local issue links, and use .dir namesHEADmaster
Munge any links to local git issues to this new format. Use hidden directories at the top level so the web server autoindex will not list them.
Diffstat (limited to 'fetch-css.sh')
-rwxr-xr-xfetch-css.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/fetch-css.sh b/fetch-css.sh
index 28a6ac9..271a2b8 100755
--- a/fetch-css.sh
+++ b/fetch-css.sh
@@ -7,7 +7,7 @@ INGLOB=*.html
SEDSCRIPT=/mnt/public/work/devuan/fix-css-in-html.sed
# OUTDIR will be made in INDIR, because of the `cd` below.
-OUTDIR=css
+OUTDIR=.css
test ! -d "${OUTDIR}" && mkdir -p "${OUTDIR}"
INSERVER=https://git.devuan.org
@@ -20,10 +20,12 @@ orig_css="$( sed -n -r -e 's/^.*<link.*(href="[^"]+\.css").*/\1/p' ${INGLOB} | a
cat /dev/null > "${SEDSCRIPT}"
echo "${orig_css}" | while read line ; do
- getpath="${INSERVER}${line}"
+ getpath="${INSERVER}/${line}"
targetfile="${OUTDIR}/$( basename "${line}" )"
+ targetfile="${targetfile##/}"
+ targetfile=".$( echo "${targetfile}" | sed -r -e 's/^\.+//g;' )"
test -n "${DEBUG}" && echo "process ${getpath} and save to ${targetfile}" 1>&2
test -z "${DRYRUN}" && wget --quiet --content-disposition -O "${targetfile}" "${getpath}"
# dynamically build a sed script
- echo "s:${line}:${targetfile##/}:g;" | tee -a "${SEDSCRIPT}"
+ echo "s:${line}:${targetfile}:g;" | tee -a "${SEDSCRIPT}"
done
bgstack15