nix(refactor): Add withPath to checkedShellScript
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
, inRootDir ? false
|
, inRootDir ? false
|
||||||
, redirectTixFiles ? true
|
, redirectTixFiles ? true
|
||||||
, withEnv ? null
|
, withEnv ? null
|
||||||
|
, withPath ? [ ]
|
||||||
, withTmpDir ? false
|
, withTmpDir ? false
|
||||||
}: text:
|
}: text:
|
||||||
let
|
let
|
||||||
@@ -114,6 +115,10 @@ let
|
|||||||
export PATH="$env/bin:$PATH"
|
export PATH="$env/bin:$PATH"
|
||||||
''
|
''
|
||||||
|
|
||||||
|
+ lib.optionalString (lib.length withPath > 0) ''
|
||||||
|
export PATH="${lib.concatMapStrings (p: p + "/bin:") withPath}$PATH"
|
||||||
|
''
|
||||||
|
|
||||||
+ "(${text})"
|
+ "(${text})"
|
||||||
|
|
||||||
+ lib.optionalString withTmpDir ''
|
+ lib.optionalString withTmpDir ''
|
||||||
|
|||||||
@@ -14,10 +14,9 @@ let
|
|||||||
name = "postgrest-test-memory";
|
name = "postgrest-test-memory";
|
||||||
docs = "Run the memory tests.";
|
docs = "Run the memory tests.";
|
||||||
inRootDir = true;
|
inRootDir = true;
|
||||||
|
withPath = [ postgrestProfiled curl ];
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
export PATH="${postgrestProfiled}/bin:${curl}/bin:$PATH"
|
|
||||||
|
|
||||||
${withTools.latest} test/memory-tests.sh
|
${withTools.latest} test/memory-tests.sh
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -73,10 +73,9 @@ let
|
|||||||
docs = "Dump the loaded schema's DbStructure as a yaml file.";
|
docs = "Dump the loaded schema's DbStructure as a yaml file.";
|
||||||
inRootDir = true;
|
inRootDir = true;
|
||||||
withEnv = postgrest.env;
|
withEnv = postgrest.env;
|
||||||
|
withPath = [ jq ];
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
export PATH="${jq}/bin:$PATH"
|
|
||||||
|
|
||||||
${withTools.latest} \
|
${withTools.latest} \
|
||||||
${cabal-install}/bin/cabal v2-run ${devCabalOptions} --verbose=0 -- \
|
${cabal-install}/bin/cabal v2-run ${devCabalOptions} --verbose=0 -- \
|
||||||
postgrest --dump-schema \
|
postgrest --dump-schema \
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ let
|
|||||||
addCommandCompletion = true;
|
addCommandCompletion = true;
|
||||||
inRootDir = true;
|
inRootDir = true;
|
||||||
redirectTixFiles = false;
|
redirectTixFiles = false;
|
||||||
|
withPath = [ postgresql ];
|
||||||
withTmpDir = true;
|
withTmpDir = true;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
@@ -32,8 +33,7 @@ let
|
|||||||
if test -v PGRST_DB_URI; then
|
if test -v PGRST_DB_URI; then
|
||||||
exec "$@"
|
exec "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export PATH=${postgresql}/bin:"$PATH"
|
|
||||||
setuplog="$tmpdir/setup.log"
|
setuplog="$tmpdir/setup.log"
|
||||||
|
|
||||||
log () {
|
log () {
|
||||||
|
|||||||
Reference in New Issue
Block a user