Commit bc3b7813 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

Vérification de l'existence du bin basex. Fixes #83.

parent 1d28bd73
......@@ -6,6 +6,24 @@ AVAILABLE_PLUGINS_DIR=$DIRECTORY/../plugins-available
ENABLED_PLUGINS_DIR=$DIRECTORY/../plugins-enabled
MAX_PLUGINS_DIR=$AVAILABLE_PLUGINS_DIR/default
CUSTOM_PLUGINS_DIR=$AVAILABLE_PLUGINS_DIR/custom
BASEX_CLIENT_BIN="basexclient"
BASEX_BIN="basex"
#checks and set basex bin
a=$(command -v basexclient)
if [ -z $a ] && [ -z $BASEX_PATH ]
then
echo "Please install BaseX or set \$BASEX_PATH environment variable"
exit 1
else
if [ -z $a ]
then
BASEX_CLIENT_BIN=$BASEX_PATH"/bin/basexclient"
BASEX_BIN=$BASEX_PATH"/bin/basex"
fi
fi
display_usage(){
echo ""
......@@ -91,7 +109,7 @@ disable_plugin(){
enable_project_plugins(){
config_file=$DIRECTORY/../editions/$1/$1_config_inc.xml
plugins=$(basex -i$config_file "for \$i in //plugins/plugin/@name return string(\$i)")
plugins=$($BASEX_BIN -i$config_file "for \$i in //plugins/plugin/@name return string(\$i)")
for p in $plugins
do enable_plugin $p
done
......@@ -137,19 +155,7 @@ db_demo_feed(){
}
#adds xml datas to a new db
db_project_feed(){
a=$(command -v basexclient)
if [ -z $a ] && [ -z $BASEX_PATH ]
then
echo "Please install BaseX or set \$BASEX_PATH environment variable"
exit 1
else
if [ ! -z $a ]
then
feed_cmd="basexclient -p$PORT -w -cfeed.txt"
else
feed_cmd="$BASEX_PATH/bin/basexclient -p$PORT -w -cfeed.txt"
fi
feed_cmd=$BASEX_CLIENT_BIN" -p$PORT -w -cfeed.txt"
echo "Please type your BaseX login/password :"
echo "CREATE DATABASE "$1 > feed.txt
echo "ADD "$2 >> feed.txt
......@@ -161,7 +167,6 @@ db_project_feed(){
rm feed.txt
echo "INFO: The "$1" DB was successfully created."
fi
fi
}
demo_edition_build(){
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment