tvl-depot/tests/build-hook.hook.sh
Eelco Dolstra 3a2bbe7f8a * Simplify communication with the hook a bit (don't use file
descriptors 3/4, just use stdin/stderr).
2009-03-28 19:29:55 +00:00

21 lines
332 B
Bash
Executable file

#! /bin/sh
#set -x
drv=$4
echo "HOOK for $drv" >&2
outPath=$(sed 's/Derive(\[("out",\"\([^\"]*\)\".*/\1/' $drv)
echo "output path is $outPath" >&2
if $(echo $outPath | grep -q input-1); then
echo "# accept" >&2
read x
echo "got $x"
mkdir $outPath
echo "BAR" > $outPath/foo
else
echo "# decline" >&2
fi