openfoam/doc/Doxygen/Allwmake
2017-02-06 09:15:18 +01:00

79 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
[ -d "$WM_PROJECT_DIR" ] || {
echo "Error (${0##*/}) : no \$WM_PROJECT_DIR found"
echo " Check your OpenFOAM environment and installation"
echo " WM_PROJECT_DIR=$WM_PROJECT_DIR"
exit 1
}
usage() {
exec 1>&2
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
cat<<USAGE
usage: ${0##*/} [OPTION]
options:
-online use links to the Github repositories instead of the local source code
-help
USAGE
exit 1
}
defineURL() {
WEB_PATH="https://develop.openfoam.com"
FOAM_REPO_VERSION="$WM_PROJECT-plus"
case "$WM_PROJECT_VERSION" in
v[1-9][.0-9]*)
FOAM_REPO_TAG="$WM_PROJECT-$WM_PROJECT_VERSION"
;;
*)
FOAM_REPO_TAG="master"
;;
esac
export FOAM_BASE_REPO="$WEB_PATH/Development/$FOAM_REPO_VERSION"
export FOAM_ONLINE_REPO="$FOAM_BASE_REPO/blob/${FOAM_REPO_TAG}"
}
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-h | -help)
usage
;;
-online)
defineURL
;;
*)
usage "unknown option/argument: '$1'"
;;
esac
shift
done
#------------------------------------------------------------------------------
rm -rf latex man
# remove html directory in background
mv html html-stagedRemove$$ 2> /dev/null
rm -rf html-stagedRemove$$ >/dev/null 2>&1 &
# ensure that created files are readable by everyone
umask 22
doxygen
# fix permissions (NB: '+X' and not '+x'!)
chmod -R a+rX html latex man 2>/dev/null
echo
echo "Done doxygen"
echo
#------------------------------------------------------------------------------