Skip to content

Commit abebfbb

Browse files
Valyrian-Codegiohappy
authored andcommitted
Quote variables in entrypoint.sh test conditions
FORCE_REINIT is not set in .env.sample (only referenced in a comment), so on a normal start '[ ${FORCE_REINIT} = "true" ]' runs as '[ = "true" ]' and errors with '[: =: unary operator expected'. The || chain falls through to the lock-file check so init still works, but the error is printed on every startup and the toggle is fragile. Quote the compared variables (also INVOKE_LOG_STDOUT and IS_CELERY) so an empty value compares cleanly.
1 parent aace86c commit abebfbb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/entrypoint.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -e
55

66
INVOKE_LOG_STDOUT=${INVOKE_LOG_STDOUT:-FALSE}
77
invoke () {
8-
if [ $INVOKE_LOG_STDOUT = 'true' ] || [ $INVOKE_LOG_STDOUT = 'True' ]
8+
if [ "$INVOKE_LOG_STDOUT" = 'true' ] || [ "$INVOKE_LOG_STDOUT" = 'True' ]
99
then
1010
/usr/local/bin/invoke $@
1111
else
@@ -29,15 +29,15 @@ source $HOME/.override_env
2929

3030
cmd="$@"
3131

32-
if [ ${IS_CELERY} = "true" ] || [ ${IS_CELERY} = "True" ]
32+
if [ "${IS_CELERY}" = "true" ] || [ "${IS_CELERY}" = "True" ]
3333
then
3434
echo "Executing Celery server $cmd for Production"
3535
else
3636

3737
invoke migrations
3838
invoke prepare
3939

40-
if [ ${FORCE_REINIT} = "true" ] || [ ${FORCE_REINIT} = "True" ] || [ ! -e "/mnt/volumes/statics/geonode_init.lock" ]; then
40+
if [ "${FORCE_REINIT}" = "true" ] || [ "${FORCE_REINIT}" = "True" ] || [ ! -e "/mnt/volumes/statics/geonode_init.lock" ]; then
4141
invoke fixtures
4242
invoke initialized
4343
invoke updateadmin

0 commit comments

Comments
 (0)