3232checkout_to_latest_tag () {
3333 if [ -d $1 ]; then
3434 pushd $1
35- git fetch --tags
36- tag=$( git describe --tags ` git rev-list --tags --max-count=1` )
37- git checkout $tag -b $tag
38- git pull origin $tag
35+ if git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then
36+ git fetch --tags
37+ tag=$( git describe --tags ` git rev-list --tags --max-count=1` )
38+ git checkout $tag -b $tag
39+ git pull origin $tag
40+ else
41+ echo " No .git metadata in $1 ; skipping frontend repository update."
42+ fi
3943 popd
4044 fi
4145}
@@ -51,11 +55,10 @@ if [[ ! -f "config/autoload/local.php" && $bypass -eq 0 ]]; then
5155 exit 1
5256fi
5357
54- git pull
55-
56- if [ $? != 0 ]; then
57- echo " A problem occurred while retrieving remote files from repository."
58- exit 1
58+ if git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then
59+ git pull || { echo " A problem occurred while retrieving remote files from repository." ; exit 1; }
60+ else
61+ echo " No .git metadata; skipping git pull."
5962fi
6063
6164./scripts/check_composer.sh
@@ -87,21 +90,29 @@ if [[ $bypass -eq 0 ]]; then
8790 migrate_module $pathFO
8891fi
8992
90- if [[ -d node_modules && -d node_modules/ng_anr ]]; then
91- if [[ -d node_modules/ng_anr/.git ]]; then
93+ if [[ -d node_modules/ng_client && -d node_modules/ng_anr ]]; then
94+ if [[ -d node_modules/ng_client/.git && -d node_modules/ ng_anr/.git ]]; then
9295 checkout_to_latest_tag node_modules/ng_client
9396 checkout_to_latest_tag node_modules/ng_anr
9497 else
95- npm update
98+ echo " node_modules/ng_* are not git repos; skipping frontend repository update. "
9699 fi
97100fi
98101
99- cd node_modules/ng_client
100- npm ci
101- cd ../..
102+ if [[ -d node_modules/ng_client ]]; then
103+ cd node_modules/ng_client
104+ npm ci
105+ cd ../..
106+ else
107+ echo " node_modules/ng_client not found; skipping npm ci."
108+ fi
102109
103- ./scripts/link_modules_resources.sh
104- ./scripts/compile_translations.sh
110+ if [[ -d node_modules/ng_client && -d node_modules/ng_anr ]]; then
111+ ./scripts/link_modules_resources.sh
112+ ./scripts/compile_translations.sh
113+ else
114+ echo " Frontend repositories are missing; skipping resource linking and translation compilation."
115+ fi
105116
106117if [[ $forceClearCache -eq 1 ]]; then
107118 # Clear Laminas cache
0 commit comments