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 ...@@ -6,6 +6,24 @@ AVAILABLE_PLUGINS_DIR=$DIRECTORY/../plugins-available
ENABLED_PLUGINS_DIR=$DIRECTORY/../plugins-enabled ENABLED_PLUGINS_DIR=$DIRECTORY/../plugins-enabled
MAX_PLUGINS_DIR=$AVAILABLE_PLUGINS_DIR/default MAX_PLUGINS_DIR=$AVAILABLE_PLUGINS_DIR/default
CUSTOM_PLUGINS_DIR=$AVAILABLE_PLUGINS_DIR/custom 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(){ display_usage(){
echo "" echo ""
...@@ -91,7 +109,7 @@ disable_plugin(){ ...@@ -91,7 +109,7 @@ disable_plugin(){
enable_project_plugins(){ enable_project_plugins(){
config_file=$DIRECTORY/../editions/$1/$1_config_inc.xml 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 for p in $plugins
do enable_plugin $p do enable_plugin $p
done done
...@@ -137,31 +155,18 @@ db_demo_feed(){ ...@@ -137,31 +155,18 @@ db_demo_feed(){
} }
#adds xml datas to a new db #adds xml datas to a new db
db_project_feed(){ db_project_feed(){
a=$(command -v basexclient) feed_cmd=$BASEX_CLIENT_BIN" -p$PORT -w -cfeed.txt"
echo "Please type your BaseX login/password :"
if [ -z $a ] && [ -z $BASEX_PATH ] echo "CREATE DATABASE "$1 > feed.txt
then echo "ADD "$2 >> feed.txt
echo "Please install BaseX or set \$BASEX_PATH environment variable" eval $feed_cmd
exit 1 ret_code=$?
else if [ $ret_code -gt 0 ]
if [ ! -z $a ] then echo "Cannot insert data in DB. Is yout BaseX running on "$PORT" ?"
then else
feed_cmd="basexclient -p$PORT -w -cfeed.txt" rm feed.txt
else echo "INFO: The "$1" DB was successfully created."
feed_cmd="$BASEX_PATH/bin/basexclient -p$PORT -w -cfeed.txt" fi
fi
echo "Please type your BaseX login/password :"
echo "CREATE DATABASE "$1 > feed.txt
echo "ADD "$2 >> feed.txt
eval $feed_cmd
ret_code=$?
if [ $ret_code -gt 0 ]
then echo "Cannot insert data in DB. Is yout BaseX running on "$PORT" ?"
else
rm feed.txt
echo "INFO: The "$1" DB was successfully created."
fi
fi
} }
demo_edition_build(){ 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