[IMP] use [[ instead of [ for conditionals
Replace single bracket [ ] with double bracket [[ ]] for all test conditionals in the main scripts. Benefits of [[ over [: - No need to quote variables (though we still do for consistency) - Supports regex matching with =~ - Supports pattern matching with == and != - && and || work inside [[ ]] without escaping - More predictable behavior with empty strings - Is a bash keyword, not an external command Note: posbox scripts are left unchanged as they appear to be third-party code imported into the repository.
This commit is contained in:
@@ -16,7 +16,7 @@ if ! docker ps | grep -q "$DB_CONTAINER_NAME"; then
|
||||
fi
|
||||
|
||||
EXT_EXISTS=$(query_postgres_container "SELECT 1 FROM pg_extension WHERE extname = 'dblink'" "$DB_NAME") || exit 1
|
||||
if [ "$EXT_EXISTS" != "1" ]; then
|
||||
if [[ "$EXT_EXISTS" != "1" ]]; then
|
||||
query_postgres_container "CREATE EXTENSION dblink;" "$DB_NAME" || exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user