diff --git a/utils/init_symlinks.sh b/utils/init_symlinks.sh index 20929dcee3b4fa3c41fa7cb28775c9302d3e6bfa..5fa28556be0bbab7c5ab6938253fa9d13d31599e 100755 --- a/utils/init_symlinks.sh +++ b/utils/init_symlinks.sh @@ -11,8 +11,8 @@ # # - -APP_NAME="vmap" +echo -n "Existing app path (path/empty)? " +read APP_EXISTING_PATH # Récupère la liste des dépendances . ./get_deps.sh @@ -21,37 +21,64 @@ cd .. # Vitis echo "---- Link vitis ----" +if [ "$(pwd)/client" ]; then + rm client +fi ln -rsf src/vitis/client client +if [ "$(pwd)/vas" ]; then + rm vas +fi ln -rsf src/vitis/vas vas # Conf -echo "---- Link ${APP_NAME}/conf ----" +echo "---- Link conf ----" +if [ -f "src/vitis/client/conf" ]; then + rm src/vitis/client/conf +fi ln -rsf conf src/vitis/client/conf +if [ -f "conf/closure" ]; then + rm conf/closure +fi ln -rsf src/closure/conf conf/closure # Modules if [[ $depsCount > 0 ]]; then for (( i=1; i <= $depsCount; i++ )); do if [ ${aDeps[$i, nature]} == "modules" ]; then - if [ ${aDeps[$i, nature]:0:7} == "module_" ]; then - $module = ${aDeps[$i, name]:7} + if [ ${aDeps[$i, name]:0:7} == "module_" ]; then + module = ${aDeps[$i, name]:7} echo "---- Link module_${module} ----" if [ -d "$(pwd)/src/module_${module}/module" ]; then + if [ -f "src/vitis/client/modules/${module}" ]; then + rm src/vitis/client/modules/${module} + fi ln -rsf src/module_${module}/module src/vitis/client/modules/${module} fi if [ -d "$(pwd)/src/module_${module}/web_service/ws" ]; then + if [ -f "src/vitis/vas/rest/ws/${module}" ]; then + rm src/vitis/vas/rest/ws/${module} + fi ln -rsf src/module_${module}/web_service/ws src/vitis/vas/rest/ws/${module} fi if [ -d "$(pwd)/src/module_${module}/web_service/conf" ]; then + if [ -f "src/vitis/vas/rest/conf/${module}" ]; then + rm src/vitis/vas/rest/conf/${module} + fi ln -rsf src/module_${module}/web_service/conf src/vitis/vas/rest/conf/${module} fi if [ -d "$(pwd)/src/module_${module}/web_service/sql" ]; then - ln -rsf src/module_${module}/web_service/conf src/vitis/vas/sql/${module} + if [ -f "src/vitis/vas/sql/${module}" ]; then + rm src/vitis/vas/sql/${module} + fi + ln -rsf src/module_${module}/web_service/sql src/vitis/vas/sql/${module} fi if [ -d "$(pwd)/src/module_${module}/web_service/class" ]; then for class_dir in $( ls "$(pwd)/src/module_${module}/web_service/class"); do if [ -d "$(pwd)/src/module_${module}/web_service/class/${class_dir}" ]; then echo "---- Link module_${module}/${class_dir} ----" + if [ -f "src/vitis/vas/rest/class/${class_dir}" ]; then + rm src/vitis/vas/rest/class/${class_dir} + fi ln -rsf src/module_${module}/web_service/class/${class_dir} src/vitis/vas/rest/class/${class_dir} fi done @@ -59,4 +86,25 @@ if [[ $depsCount > 0 ]]; then fi fi done + + # Utilisation d'une install déjà existante + if [ -d "${APP_EXISTING_PATH}" ]; then + echo "---- Link exixting app ${APP_EXISTING_PATH} ----" + + existing_folders_path[0] = "vas/server" + existing_folders_path[1] = "vas/log" + existing_folders_path[2] = "vas/public" + existing_folders_path[3] = "vas/shared" + existing_folders_path[4] = "vas/tmp" + existing_folders_path[5] = "vas/upload" + existing_folders_path[6] = "vas/ws_data" + + existing_folders_path[8] = "vas/rest/conf" + file_existing_path[0] = "client/conf/properties.json" + file_existing_path[1] = "vas/rest/.htaccess" + + # for i in "${arrayName[@]}" do + # + # done + fi fi