diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2017-03-05 19:06:03 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2017-03-05 19:06:03 +0100 |
commit | 23d27034dd3eee14e3fe953a3aea0e27c9739569 (patch) | |
tree | 526e63894a5136e50ed5c30dbd3404b15697604c /strus/create_xml.sh | |
parent | ec22ee8f502797676b9704b8313f77e7dc86be1e (diff) | |
download | www-andreasbaumann-cc-23d27034dd3eee14e3fe953a3aea0e27c9739569.tar.gz www-andreasbaumann-cc-23d27034dd3eee14e3fe953a3aea0e27c9739569.tar.bz2 |
fixed to run on OSX with software installed from brew (hugo, etc.)
Diffstat (limited to 'strus/create_xml.sh')
-rwxr-xr-x | strus/create_xml.sh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/strus/create_xml.sh b/strus/create_xml.sh index fa7ddd6..422e16f 100755 --- a/strus/create_xml.sh +++ b/strus/create_xml.sh @@ -5,9 +5,15 @@ cat <<EOF <posts> EOF +if test `uname -s` = 'Darwin'; then + SED=gsed +else + SED=sed +fi + for file in `find ../content/ -name '*.md'`; do echo "$file.." 1>&2 - slug=`echo $file | sed 's@../content@@g' | sed 's@/_index.md$@@g' | sed 's@.md$@@g'` + slug=`echo $file | $SED 's@../content@@g' | $SED 's@/_index.md$@@g' | $SED 's@.md$@@g'` if test "x$slug" = "x"; then slug="/" fi @@ -21,12 +27,12 @@ for file in `find ../content/ -name '*.md'`; do tail -n +2 F1 > meta.toml tail -n +3 F2 > body.md - sed -i 's/\&/&/g' meta.toml - sed -i 's/</\</g' meta.toml - sed -i 's/>/\>/g' meta.toml - sed -i 's/\&/&/g' body.md - sed -i 's/</\</g' body.md - sed -i 's/>/\>/g' body.md + $SED -i 's/\&/&/g' meta.toml + $SED -i 's/</\</g' meta.toml + $SED -i 's/>/\>/g' meta.toml + $SED -i 's/\&/&/g' body.md + $SED -i 's/</\</g' body.md + $SED -i 's/>/\>/g' body.md remarshal -if toml -of json meta.toml > meta.json pandoc -f markdown -t docbook body.md > body.xml |