mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-11 06:55:40 +03:00
check.nix: Don't cd when src is from srcOnly (#1542)
This commit is contained in:
parent
66ae51e640
commit
f9090d21d7
@ -4,6 +4,14 @@ drv:
|
||||
let
|
||||
component = drv.config;
|
||||
|
||||
subdir =
|
||||
if drv?source
|
||||
then
|
||||
drv.srcSubDir or ""
|
||||
else
|
||||
# srcOnly returns just the subdir, so we're already in it.
|
||||
"";
|
||||
|
||||
# This derivation can be used to execute test component.
|
||||
# The $out of the derivation is a file containing the resulting
|
||||
# stdout output.
|
||||
@ -30,8 +38,8 @@ in stdenv.mkDerivation ({
|
||||
mkdir $out
|
||||
${
|
||||
# Change to the source sub directory if there is one.
|
||||
lib.optionalString (drv.srcSubDir or "" != "") ''
|
||||
cd ${lib.removePrefix "/" drv.srcSubDir}
|
||||
lib.optionalString (subdir != "") ''
|
||||
cd ${lib.removePrefix "/" subdir}
|
||||
''
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user