Use -n instead of ! -z in shell scripts (#4404)

Signed-off-by: Joakim Roubert <joakim.roubert@axis.com>
This commit is contained in:
Joakim Roubert 2020-05-15 21:03:06 +02:00 committed by GitHub
parent 41ce6ccdbd
commit 0b58a56637
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ check_if_k8s_reachable(){
remove_l5d_if_exists() {
resources=$(kubectl --context=$k8s_context get all,clusterrole,clusterrolebinding,mutatingwebhookconfigurations,validatingwebhookconfigurations,psp,crd -l linkerd.io/control-plane-ns --all-namespaces -oname)
if [ ! -z "$resources" ]; then
if [ -n "$resources" ]; then
printf 'Removing existing l5d installation...'
cleanup
printf '[ok]\n'

View File

@ -10,7 +10,7 @@ dirs=$(go list -f \{\{.Dir\}\} ./... | grep -v controller/gen)
# dedup them.
files=$(bin/goimports -l $dirs | sort | uniq)
if [ ! -z "$files" ]; then
if [ -n "$files" ]; then
for file in $files; do
bin/goimports -d "$@" "$file"
done