From 9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8 Mon Sep 17 00:00:00 2001 From: Artturin Date: Fri, 28 Jul 2023 04:20:26 +0300 Subject: [PATCH] stdenv: Make condition clearer -z checks for a empty string -n checks for a not empty string It makes more sense to run the chmod if the string is not empty --- pkgs/stdenv/generic/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 1f596ada5a0b..7fe5f67b14de 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -1594,7 +1594,7 @@ genericBuild() { if [ "$curPhase" = unpackPhase ]; then # make sure we can cd into the directory - [ -z "${sourceRoot}" ] || chmod +x "${sourceRoot}" + [ -n "${sourceRoot:-}" ] && chmod +x "${sourceRoot}" cd "${sourceRoot:-.}" fi