on iko/ghcjs-patch-master help sign in
check.nix: Don't cd when src is from srcOnly (#1542)
commitf9090d21d784f5417f0e228a52b3943ab6458a36 authorRobert Hensing <roberth@users.noreply.github.com> dateWed 13 Jul 2022, 02:25 (4 years ago) parent66ae51e
1 file changed+10−2
lib/check.nix+10−2
lib/check.nix+10−2
@@ -4,6 +4,14 @@ drv:
44let
55 component = drv.config;
66
7+ subdir =
8+ if drv?source
9+ then
10+ drv.srcSubDir or ""
11+ else
12+ # srcOnly returns just the subdir, so we're already in it.
13+ "";
14+
715# This derivation can be used to execute test component.
816# The $out of the derivation is a file containing the resulting
917# stdout output.
@@ -30,8 +38,8 @@ in stdenv.mkDerivation ({
3038 mkdir $out
3139 ${
3240 # Change to the source sub directory if there is one.
33− lib.optionalString (drv.srcSubDir or "" != "") ''
34− cd ${lib.removePrefix "/" drv.srcSubDir}
41+ lib.optionalString (subdir != "") ''
42+ cd ${lib.removePrefix "/" subdir}
3543 ''
3644 }
3745