summaryrefslogtreecommitdiffstats
path: root/import-translations
diff options
context:
space:
mode:
authoranonym <anonym@riseup.net>2015-09-26 19:11:48 +0200
committeranonym <anonym@riseup.net>2016-02-11 17:29:08 +0100
commit364a3c8d14ffb37ba23005177ccdb3d74f42c424 (patch)
tree1848ec9b139b4b0eecb4b29407b852d1318cc365 /import-translations
parentbbc2d6ca07d90caa9a8a3ecd09cc5393159c09fc (diff)
Avoid set -u issue when testing if variable is set or not.
Whenever there's a risk that we will reference a shell variable in a script run with `set -u` (including libraries that we sources from such scripts) we must reference the variable in a way so it gets a default value, i.e. `${VAR:-}` to give it the empty string as the default (which is what generally makes sense). In particular, it's quite clear that in all cases where we do something like `[ -n "${VAR}" ]` or `[ -z "${VAR}" ]`, where an expected value is the empty string, which could mean that the variable is not initialized, we should give such a default (as the empty string).
Diffstat (limited to 'import-translations')
-rwxr-xr-ximport-translations2
1 files changed, 1 insertions, 1 deletions
diff --git a/import-translations b/import-translations
index c63d7dc..3bd43c1 100755
--- a/import-translations
+++ b/import-translations
@@ -72,6 +72,6 @@ find "$TOR_TRANSLATION_DIR" -name '*.po' | while read po_file; do
done
# Update PO files
-if [ -n "$AFTER_IMPORT" ]; then
+if [ -n "${AFTER_IMPORT:-}" ]; then
eval "$AFTER_IMPORT"
fi