#!/usr/bin/env bash # place this file in mod ".ldoc" directory d_ldoc="$(dirname $(readlink -f $0))" cd "${d_ldoc}/.." d_root="$(pwd)" d_export="${d_export:-${d_root}/docs/reference}" cmd_ldoc="${d_root}/../ldoc/ldoc.lua" if test -f "${cmd_ldoc}"; then if test ! -x "${cmd_ldoc}"; then chmod +x "${cmd_ldoc}" fi else cmd_ldoc="ldoc" fi # clean old files rm -rf "${d_export}" # store current branch main_branch="$(git branch --show-current)" html_out="\n\n\n\n\n\n\n" cd "${d_root}" git checkout ${main_branch} echo -e "${html_out}" > "${d_export}/index.html" echo -e "\nDone!"