Commit 5e81aa18 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

-v option (get max version)

parent 02c37d40
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@ last_gitlab_project_release(){
display_usage(){
    echo
    echo -e "\t-h: Display help."
    echo -e "\t-v: Display MaX version."
    echo -e "\t-p: Specify BaseX port to use for db feed. Default one is $PORT."
    echo -e "\t-b: Specify custom BaseX home. Common BaseX will be used by default if presents."
    echo -e "\t-i: Max initialization."
@@ -31,25 +32,29 @@ display_usage(){

PORT=1984
DIRECTORY=$(cd "$(dirname "$0")" && pwd)

#read max version in package.json(dev mode) file or VERSION file (prod mode)
if [[ ! -f ${DIRECTORY}/../VERSION ]]
then
  MAX_VERSION=$(node -p -e "require('${DIRECTORY}/../package.json').version")'-dev'
else
  MAX_VERSION=$(cat "${DIRECTORY}/../VERSION")
fi

# save args for end of script routines
args=( "$@" )
while [[ "$#" -gt 0 ]]; do
    case $1 in
        -h) display_usage
            exit 0;;
        -v) echo $MAX_VERSION
            exit 0;;
        -p) PORT="$2"; shift ;;
        -b) BASEX_PATH="$2"; shift ;;
    esac
    shift
done

#read max version in package.json(dev mode) file or VERSION file (prod mode)
if [[ ! -f ${DIRECTORY}/../VERSION ]]
then
  MAX_VERSION=$(node -p -e "require('${DIRECTORY}/../package.json').version")'-dev'
else
  MAX_VERSION=$(cat "${DIRECTORY}/../VERSION")
fi

MAX_PLUGINS_DIR=${DIRECTORY}/../plugins
BASEX_CLIENT_BIN="basexclient"
@@ -154,7 +159,6 @@ install_jar_in_libs $SAXON_HE_URL
install_jar_in_libs $FOP_URL
echo


list_plugins(){
  echo
  echo -e ' --- MaX plugins --- '