From 53a26943ca83fc76d6cc6424b3309b6d14a98142 Mon Sep 17 00:00:00 2001
From: Armand Bahi <armand.bahi@veremes.com>
Date: Mon, 15 Oct 2018 16:20:47 +0000
Subject: [PATCH] Update utils/init_symlinks.sh

---
 utils/init_symlinks.sh | 38 ++++++++++++++++++++++++++------------
 1 file changed, 26 insertions(+), 12 deletions(-)

diff --git a/utils/init_symlinks.sh b/utils/init_symlinks.sh
index 7de78fe7..11be3da0 100755
--- a/utils/init_symlinks.sh
+++ b/utils/init_symlinks.sh
@@ -97,18 +97,32 @@ if [[ $depsCount > 0 ]]; then
 			fi
 		done
 
-		file_path="client/conf/properties.json"
-		if [ -f "${APP_EXISTING_PATH}/$file_path" ]; then
-			echo "copy $file_path"
-			cp -f "${APP_EXISTING_PATH}/$file_path" "$(pwd)/$file_path"
-		fi
-
-		file_path="vas/rest/.htaccess"
-		if [ -f "${APP_EXISTING_PATH}/$file_path" ]; then
-			echo "copy $file_path"
-			cp -f "${APP_EXISTING_PATH}/$file_path" "$(pwd)/$file_path"
-		fi
-		# file_existing_path[2]="vas/rest/conf"
+		declare -a existing_files_path=("client/conf/properties.json"
+										"vas/rest/conf/properties.inc"
+										"vas/rest/conf/properties_domain.inc"
+										"vas/rest/conf/properties_post.inc"
+										"vas/rest/conf/properties_server.inc"
+										"vas/rest/conf/version.inc"
+										"vas/rest/.htaccess")
+		for file_path in "${existing_files_path[@]}"; do
+			if [ -f "${APP_EXISTING_PATH}/$file_path" ]; then
+				echo "copy $file_path"
+				cp -f "${APP_EXISTING_PATH}/$file_path" "$(pwd)/$file_path"
+			fi
+		done
 
+		for properties_dir in $( ls "${APP_EXISTING_PATH}/vas/rest/conf"); do
+			if [ -d "${APP_EXISTING_PATH}/vas/rest/conf/${properties_dir}" ]; then
+				if [ -d "$(pwd)/vas/rest/conf/${properties_dir}" ]; then
+					for properties_file in $( ls "${APP_EXISTING_PATH}/vas/rest/conf/${properties_dir}"); do
+						# if [ ${properties_file:0:10}=="properties"  ||  ${properties_file}=="version.inc" ]; then
+						if [[ $properties_file == "properties"* ]] || [[ $properties_file == "version.inc" ]]; then
+							echo "copy vas/rest/conf/${properties_dir}/${properties_file}"
+							cp -f "${APP_EXISTING_PATH}/vas/rest/conf/${properties_dir}/${properties_file}" "$(pwd)/vas/rest/conf/${properties_dir}/${properties_file}"
+						fi
+					done
+				fi
+			fi
+		done
 	fi
 fi
-- 
GitLab