Quote variable for test -n calls

$ test -n; echo $?
0
$ test -n ""; echo $?
1
This commit is contained in:
Benjamin Drung 2017-04-21 12:10:44 +02:00 committed by Praveen Arimbrathodiyil
parent 54f0d8896a
commit ac68fae02e

4
debian/postrm vendored
View file

@ -23,7 +23,7 @@ if [ -f ${gitlab_debian_defaults} ]; then . ${gitlab_debian_defaults}; fi
safely_remove() {
CANDIDATE_DIR=$1
if [ -n ${CANDIDATE_DIR} ];then
if [ -n "${CANDIDATE_DIR}" ];then
if [ -e ${CANDIDATE_DIR} ]; then
echo "Removing $i..."
rm -rf ${CANDIDATE_DIR}
@ -117,7 +117,7 @@ ${gitlab_tmpfiles} ${gitlab_shell_config}; do
done
# remove generated assets
if [ -n ${gitlab_data_dir} ]; then safely_remove ${gitlab_data_dir}/public/assets; fi
if [ -n "${gitlab_data_dir}" ]; then safely_remove ${gitlab_data_dir}/public/assets; fi
# Remove private copies of configuration files
rm -f ${nginx_site_private}