2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 14:21:05 +00:00

chore: fixes to shell scripts

* envsubst: expression may fail to expand in single quotes
* use (()) instead of let
* use find instead of ls to better hand alphanumeric folders

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
This commit is contained in:
Chinmay D. Pai 2020-02-20 12:33:52 +05:30
parent 3b5f829248
commit 347b94dee2
No known key found for this signature in database
GPG Key ID: 75507BE256F40CED
4 changed files with 10 additions and 10 deletions

View File

@ -29,7 +29,7 @@ if [[ -z "$FRAPPE_SOCKETIO_PORT" ]]; then
export FRAPPE_SOCKETIO_PORT=9000
fi
envsubst '${API_HOST} ${API_PORT} ${ERPNEXT_PY} ${ERPNEXT_PY_PORT} ${FRAPPE_SOCKETIO} ${FRAPPE_SOCKETIO_PORT}' \
envsubst "${API_HOST} ${API_PORT} ${ERPNEXT_PY} ${ERPNEXT_PY_PORT} ${FRAPPE_SOCKETIO} ${FRAPPE_SOCKETIO_PORT}" \
< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
exec "$@"

View File

@ -28,11 +28,11 @@ function configureEnv() {
exit 1
fi
envsubst '${MARIADB_HOST}
envsubst "${MARIADB_HOST}
${REDIS_CACHE}
${REDIS_QUEUE}
${REDIS_SOCKETIO}
${SOCKETIO_PORT}' < /opt/frappe/common_site_config.json.template > /home/frappe/frappe-bench/sites/common_site_config.json
${SOCKETIO_PORT}" < /opt/frappe/common_site_config.json.template > /home/frappe/frappe-bench/sites/common_site_config.json
fi
}
@ -45,7 +45,7 @@ function checkConfigExists() {
COUNTER=0
while [[ ! -e /home/frappe/frappe-bench/sites/common_site_config.json ]] && [[ $COUNTER -le 30 ]] ; do
sleep 1
let COUNTER=COUNTER+1
(( COUNTER=COUNTER+1 ))
echo "config file not created, retry $COUNTER"
done
@ -56,7 +56,7 @@ function checkConfigExists() {
}
if [[ ! -e /home/frappe/frappe-bench/sites/apps.txt ]]; then
ls -1 /home/frappe/frappe-bench/apps | sort -r > /home/frappe/frappe-bench/sites/apps.txt
find /home/frappe/frappe-bench/apps -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort -r > /home/frappe/frappe-bench/sites/apps.txt
fi
if [ "$1" = 'start' ]; then

View File

@ -29,7 +29,7 @@ if [[ -z "$FRAPPE_SOCKETIO_PORT" ]]; then
export FRAPPE_SOCKETIO_PORT=9000
fi
envsubst '${API_HOST} ${API_PORT} ${FRAPPE_PY} ${FRAPPE_PY_PORT} ${FRAPPE_SOCKETIO} ${FRAPPE_SOCKETIO_PORT}' \
envsubst "${API_HOST} ${API_PORT} ${FRAPPE_PY} ${FRAPPE_PY_PORT} ${FRAPPE_SOCKETIO} ${FRAPPE_SOCKETIO_PORT}" \
< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
exec "$@"

View File

@ -28,11 +28,11 @@ function configureEnv() {
exit 1
fi
envsubst '${MARIADB_HOST}
envsubst "${MARIADB_HOST}
${REDIS_CACHE}
${REDIS_QUEUE}
${REDIS_SOCKETIO}
${SOCKETIO_PORT}' < /opt/frappe/common_site_config.json.template > /home/frappe/frappe-bench/sites/common_site_config.json
${SOCKETIO_PORT}" < /opt/frappe/common_site_config.json.template > /home/frappe/frappe-bench/sites/common_site_config.json
fi
}
@ -45,7 +45,7 @@ function checkConfigExists() {
COUNTER=0
while [[ ! -e /home/frappe/frappe-bench/sites/common_site_config.json ]] && [[ $COUNTER -le 30 ]] ; do
sleep 1
let COUNTER=COUNTER+1
(( COUNTER=COUNTER+1 ))
echo "config file not created, retry $COUNTER"
done
@ -56,7 +56,7 @@ function checkConfigExists() {
}
if [[ ! -e /home/frappe/frappe-bench/sites/apps.txt ]]; then
ls -1 /home/frappe/frappe-bench/apps | sort -r > /home/frappe/frappe-bench/sites/apps.txt
find /home/frappe/frappe-bench/apps -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort -r > /home/frappe/frappe-bench/sites/apps.txt
fi
if [ "$1" = 'start' ]; then