about summary refs log tree commit diff
path: root/tests/build-hook.hook.sh
blob: bbf423017f18e6f2f66176e7f8ee0df8ff76c4ff (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh

set -x

drv=$4

echo "HOOK for $drv" >&2

outPath=$(sed 's/Derive(\[\"\([^\"]*\)\".*/\1/' $drv)

echo "output path is $outPath" >&2

if $(echo $outPath | grep -q input-1); then
    echo "accept" >&3
    read x <&4
    echo "got $x"
    mkdir $outPath
    echo "BAR" > $outPath/foo
else
    echo "decline" >&3
fi