set -Eeuo pipefail
script_dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
build_dir="$(pwd)/build"
publish_dir="$(pwd)/public"
APP_NAME="CI runner"
check=false
function print_help() {
script_name="$(basename "$0")"
echo -e ""
echo -e "$APP_NAME - Generates everything for this repo."
echo -e ""
echo -e "Usage:"
echo -e "\t$script_name [OPTION...]"
echo -e "Options:"
echo -e "\t-h, --help"
echo -e "\t\tPrint this usage help and exit"
echo -e "\t-c, --check-style"
echo -e "\t\tPrint this usage help and exit"
echo -e "Examples:"
echo -e "\t$script_name"
echo -e ""
}
while [[ $# -gt 0 ]]
do
arg="$1"
shift
case "$arg" in
-h|--help)
print_help
exit 0
;;
-c|--check-style)
check=true
;;
*) POSITIONAL+=("$arg") ;;
esac
done
set -- "${POSITIONAL[@]}"
if $check
then
"$script_dir/test" "$@"
else
"$script_dir/build" "$@"
echo "Files to be published to pages:"
rm -Rf "$publish_dir"
mv "$build_dir" "$publish_dir"
find "$publish_dir"
fi