| @@ -5,6 +5,7 @@ manage_files() { | |||
| # Define the source (folder a) and destination (folder b) | |||
| folder_a="$1" | |||
| folder_b="$2" | |||
| prefix="$3" | |||
| # Ensure both folders exist | |||
| if [[ ! -d "$folder_a" ]]; then | |||
| @@ -31,7 +32,7 @@ manage_files() { | |||
| # Check if the file already exists in folder_b | |||
| if [[ ! -e "$destination" ]]; then | |||
| # Create a symbolic link in folder_b with absolute paths | |||
| ln -s "../../node_modules/$1/$filename" "$destination" | |||
| ln -s "$3../../node_modules/$1/$filename" "$destination" | |||
| echo "Linked '../../node_modules/$1/$filename' to '$destination'" | |||
| else | |||
| echo "File '$destination' already exists, skipping..." | |||
| @@ -100,8 +101,8 @@ find_and_delete_broken_symlinks "cihsr-server/cihsr/lib/vmodel" | |||
| # Example of calling the function on multiple folder pairs | |||
| manage_files "chess-server-lib/common/models" "cihsr-server/cihsr/models" | |||
| manage_files "chess-server-lib/common/lib/vmodel" "cihsr-server/cihsr/lib/vmodel" | |||
| manage_files "chess-server-lib/common/models" "cihsr-server/cihsr/models" "" | |||
| manage_files "chess-server-lib/common/lib/vmodel" "cihsr-server/cihsr/lib/vmodel" "../" | |||
| rm "./cihsr-server/cihsr/models/labrtfresult.js" | |||
| rm "./cihsr-server/cihsr/models/dataimport.js" | |||