about summary refs log tree commit diff
path: root/pkgs/stdenv
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2023-07-28 04:20:26 +0300
committerArtturin <Artturin@artturin.com>2023-07-28 04:20:26 +0300
commit9816ca55c2fd0619542f420f8e6cfaa8ebaf4ea8 (patch)
tree069fc3a6b9ef58d8e2179328adcef9e5c180c323 /pkgs/stdenv
parent1fb560746e1f06f4f32b0ff76da3309f9284e618 (diff)
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
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r--pkgs/stdenv/generic/setup.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 1f596ada5a0b0..7fe5f67b14de8 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