Skip to content

Instantly share code, notes, and snippets.

@avsm
Created June 19, 2014 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avsm/d26e393a0cdcf7613821 to your computer and use it in GitHub Desktop.
Save avsm/d26e393a0cdcf7613821 to your computer and use it in GitHub Desktop.
postproc script for ocl website
#!/bin/sh -e
rm -rf pkg
~/src/git/avsm/opam2web/src/_build/opam2web.native --where='tag:org:mirage' --where='tag:org:ocamllabs' --prefix="/projects/ocamllabs/"
cd pkg
rm -f index-*.html
tail -n +2 index.html |sed '$d' > index-b.html
rm -f index.html
# generate subdirs
echo 'navstop=1, *glob("*/index-b.html")' > uconfig.txt
# uconfig per version
pkgs=`find . -type d -maxdepth 1 |grep -v '^\.$' | sed -e 's,^\./,,g'`
for i in $pkgs; do
cd $i
dirs=`find . -type d -maxdepth 1 |grep -v '^\.$' | sed -e 's,^\./,,g'`
echo '*glob("*/index-b.html")' > uconfig.txt
echo "<title>$i</title><body>placeholder</body>" > index-b.html
for d in $dirs; do
cd $d
mv index.html index-b.html
echo "" > uconfig.txt
cd ..
done
cd ..
done
cd ..
rm -rf ~/src/git/ocamllabs/ocl-reporter/pages/pkg
mv pkg ~/src/git/ocamllabs/ocl-reporter/pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment