Copy source tree to non-nix-builder build directory and cd to the right spot
parent
034aa74e81
commit
e6729e269f
|
@ -23,12 +23,16 @@ let
|
||||||
then imported.value
|
then imported.value
|
||||||
else {
|
else {
|
||||||
src = filterSource
|
src = filterSource
|
||||||
(path: type: type != "directory" || (baseNameOf path != ".git" && (all (x: path != x) filter)))
|
(path: type: baseNameOf path != ".git" && baseNameOf path != ".envrc" && (all (x: path != x) filter))
|
||||||
(/. + root);
|
(/. + root);
|
||||||
builder = ''
|
builder = let
|
||||||
|
relPath = dirOf (removePrefix (root + "/") builder);
|
||||||
|
in ''
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
pout=$(mktemp -u -p $PWD)
|
pout=$(mktemp -u -p $PWD)
|
||||||
|
cp -r --reflink=auto --no-preserve=mode "$src/" src
|
||||||
|
cd src/${relPath}
|
||||||
${/. + builder} $d1 $d2 $out >$pout
|
${/. + builder} $d1 $d2 $out >$pout
|
||||||
if [ -e $out -a -s $pout ]; then
|
if [ -e $out -a -s $pout ]; then
|
||||||
printf "Error: %s wrote to stdout and created \$3\n" "$d1" >&2
|
printf "Error: %s wrote to stdout and created \$3\n" "$d1" >&2
|
||||||
|
|
Loading…
Reference in New Issue