Commit 9b03332a authored by Marie Bisson's avatar Marie Bisson
Browse files

Merge branch 'dev' into mb/corrcoquilles

récupération des modifs de Jérome dev
parents ecfeb205 96ab56a9
Loading
Loading
Loading
Loading
+42 −10
Original line number Diff line number Diff line
@@ -5,6 +5,25 @@ DIRECTORY=$(cd `dirname $0` && pwd)
MAX_PLUGINS_DIR=$DIRECTORY/../plugins
BASEX_CLIENT_BIN="basexclient"
BASEX_BIN="basex"
DEMO_RELEASE_URL="https://git.unicaen.fr/chauveau/max-tei-demo/-/archive/v1.0/max-tei-demo-v1.0.zip"

dependency_test(){
  result=$(command -v $1)
  if [ -z $result ]
  then
      echo 'Dependency '$1' not satisfied - please install it first'
      exit -1
  else
      echo 'Dependency '$1' satisfied'
  fi
}

dependencies=(wget npm xmllint)

for bin in ${dependencies[@]}
do
    dependency_test $bin
done


#checks and set basex bin
@@ -38,7 +57,6 @@ display_usage(){
}



list_plugins(){
  echo -e ''
  echo -e 'MaX plugins : '
@@ -186,8 +204,15 @@ demo_edition_build(){
#    echo "  -> resource files copy: DONE"
    cd $DIRECTORY/../editions
    echo "Downloading Max TEI Demo ressources"
     wget https://git.unicaen.fr/chauveau/max-tei-demo/-/archive/v1.0/max-tei-demo-v1.0.zip

    wget $DEMO_RELEASE_URL

    getResult=$?
    if [ $getResult -ne 0 ]
    then
     echo 'MaX demo install error : Cannot fetch '$DEMO_RELEASE_URL
     exit -1
    fi
    unzip max-tei-demo-v1.0.zip
    mv max-tei-demo-v1.0 max_tei_demo
    rm max-tei-demo-v1.0.zip
@@ -255,7 +280,7 @@ init_max(){
#creates config file if not exists (.dist copy)
if [ ! -f $DIRECTORY/../configuration/configuration.xml ]
then
    echo "Configuration file does not exists: copying the .dist one"
    echo "Configuration file does not exist: copying the .dist one"
    cp  $DIRECTORY/../configuration/configuration.dist.xml $DIRECTORY/../configuration/configuration.xml
fi

@@ -268,10 +293,17 @@ then
    new_edition_build $project_id $db_path $xmlns
    read -e -p "XML sources path ? " data_path
    db_project_feed $db_path $data_path
    mkdir $DIRECTORY/../editions/$project_id/fragments
    mkdir $DIRECTORY/../editions/$project_id/xq
    mkdir $DIRECTORY/../editions/$project_id/ui
    mkdir $DIRECTORY/../editions/$project_id/ui/css
    mkdir $DIRECTORY/../editions/$project_id/ui/js
    mkdir $DIRECTORY/../editions/$project_id/ui/fonts
    mkdir $DIRECTORY/../editions/$project_id/ui/i18n
    mkdir $DIRECTORY/../editions/$project_id/ui/images
    mkdir $DIRECTORY/../editions/$project_id/ui/js
    mkdir $DIRECTORY/../editions/$project_id/ui/templates
    mkdir $DIRECTORY/../editions/$project_id/ui/xsl

    touch $DIRECTORY/../editions/$project_id/ui/css/$project_id.css
    cp $DIRECTORY/menu_default.xml $DIRECTORY/../editions/$project_id/menu.xml
    if [ $xmlns = 'ead' ]