@@ -6,18 +6,18 @@ if [ -f "/app/credentials/firebase-credentials.json" ]; then
66 echo " Firebase credentials file found at /app/credentials/firebase-credentials.json"
77 export FIREBASE_CONFIG=" /app/credentials/firebase-credentials.json"
88 export GOOGLE_APPLICATION_CREDENTIALS=" /app/credentials/firebase-credentials.json"
9- # Dosya izinlerini güvenli bir şekilde düzelt
10- if touch " /app/credentials/ firebase-credentials.json" 2> /dev/null ; then
9+ # Check if the filesystem is writable before trying to change permissions
10+ if [ -w " /app/credentials" ] && [ -w " /app/credentials/ firebase-credentials.json" ] ; then
1111 chmod 644 " /app/credentials/firebase-credentials.json"
1212 else
13- echo " Note: Firebase credentials file is read-only, skipping permissions change"
13+ echo " Note: Credentials directory or file is read-only, skipping permissions change"
1414 fi
1515elif [ -f " /app/gcp-credentials.json" ]; then
1616 echo " Firebase credentials file found at /app/gcp-credentials.json"
1717 export FIREBASE_CONFIG=" /app/gcp-credentials.json"
1818 export GOOGLE_APPLICATION_CREDENTIALS=" /app/gcp-credentials.json"
19- # Dosya izinlerini güvenli bir şekilde düzelt
20- if touch " /app/ gcp-credentials.json" 2> /dev/null ; then
19+ # Check if the filesystem is writable before trying to change permissions
20+ if [ -w " /app" ] && [ -w " /app/ gcp-credentials.json" ] ; then
2121 chmod 644 " /app/gcp-credentials.json"
2222 else
2323 echo " Note: GCP credentials file is read-only, skipping permissions change"
@@ -26,8 +26,8 @@ elif [ -f "/app/config/firebase-credentials.json" ]; then
2626 echo " Firebase credentials file found at /app/config/firebase-credentials.json"
2727 export FIREBASE_CONFIG=" /app/config/firebase-credentials.json"
2828 export GOOGLE_APPLICATION_CREDENTIALS=" /app/config/firebase-credentials.json"
29- # Dosya izinlerini güvenli bir şekilde düzelt
30- if touch " /app/config/ firebase-credentials.json" 2> /dev/null ; then
29+ # Check if the filesystem is writable before trying to change permissions
30+ if [ -w " /app/config" ] && [ -w " /app/config/ firebase-credentials.json" ] ; then
3131 chmod 644 " /app/config/firebase-credentials.json"
3232 else
3333 echo " Note: Config credentials file is read-only, skipping permissions change"
0 commit comments