Commit 02157dd2 authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

Affichage de l'aide en cas de pb réseau ou de non configuration du

parent 8b23032d
......@@ -5,6 +5,21 @@ last_gitlab_project_release(){
basename $(curl -fs -o/dev/null -w %{redirect_url} $1)
}
display_usage(){
echo ""
echo ""
echo " -h: Display help."
echo " -p: Specify BaseX port to use for db feed. Default one is "$PORT"."
echo " -i: Max initialization."
echo " -n: Deploy new edition with its XML sources."
echo " --d-tei: Deploy the TEI demo edition project."
echo " --d-ead: Deploy the EAD demo edition project."
echo " --list-plugins: Show plugins and status."
echo " --enable-plugin [plugin_name]: Enable [plugin_name] plugin."
echo " --disable-plugin [plugin_name]: Disable [plugin_name] plugin."
echo ""
}
PORT=1984
DIRECTORY=$(cd `dirname $0` && pwd)
......@@ -24,6 +39,7 @@ EAD_DEMO_URL="https://git.unicaen.fr/pdn-certic/max-ead-demo"
MAX_TEI_DEMO_VERSION_NUMBER=`last_gitlab_project_release $TEI_DEMO_URL'/-/releases/permalink/latest'`
if [ $? -gt 0 ]
then
display_usage
echo ''
echo 'MaX : Cannot access to remote url - please check your network configuration.'
exit 1
......@@ -38,7 +54,6 @@ FOP_URL="https://files.basex.org/modules/org/basex/modules/fop/FOP.jar"
DEFAULT_EAD_PLUGINS=(side_toc ead_basket)
dependency_test(){
result=$(command -v $1)
if [ -z $result ]
......@@ -71,7 +86,6 @@ install_jar_in_libs(){
echo $jar_name': ok'
}
echo "---------------------------"
echo " MaX - Utilities - "$MAX_VERSION
echo "---------------------------"
......@@ -81,6 +95,7 @@ a=$(command -v basexclient)
if [ -z $a ] && [ -z $BASEX_PATH ]
then
display_usage
echo "Please install BaseX or set \$BASEX_PATH environment variable"
exit 1
else
......@@ -91,27 +106,16 @@ else
fi
fi
echo ""
echo "Environment variable BASEX_PATH = "$BASEX_PATH
echo ""
#checks if fop & saxon he jar are in basex libs
echo ""
install_jar_in_libs $SAXON_HE_URL
install_jar_in_libs $FOP_URL
echo ""
display_usage(){
echo ""
echo ""
echo " -h: Display help."
echo " -p: Specify BaseX port to use for db feed. Default one is "$PORT"."
echo " -i: Max development env initialization."
echo " -n: Deploy new edition with its XML sources."
echo " --d-tei: Deploy the TEI demo edition project."
echo " --d-ead: Deploy the EAD demo edition project."
echo " --list-plugins: Show plugins and status."
echo " --enable-plugin [plugin_name]: Enable [plugin_name] plugin."
echo " --disable-plugin [plugin_name]: Disable [plugin_name] plugin."
echo ""
}
list_plugins(){
echo -e ''
......@@ -369,6 +373,8 @@ new_edition_build(){
init_dev_max(){
if [ -f $DIRECTORY'/../package.json' ]
then
dependency_test npm
cd $DIRECTORY/..
npm install
......@@ -383,6 +389,7 @@ init_dev_max(){
echo "
*** MaX initialization is finished :) ***
";
fi
}
......
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