-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sh
executable file
·28 lines (21 loc) · 898 Bytes
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
#Install dcrd as per instructions.
cd "$(dirname "$0")"
if [ -d $HOME/src/fuzzdcrd/ ]
then
rm -rf $HOME/src/fuzzdcrd/
fi
git clone https://github.com/decred/dcrd $HOME/src/fuzzdcrd
go get -u github.com/dvyukov/go-fuzz/go-fuzz@latest github.com/dvyukov/go-fuzz/go-fuzz-build@latest
echo "Dcrd cloned. Copying over fuzzers and compiling"
cp -r fuzzers/fuzz_* $HOME/src/fuzzdcrd/
(cd $HOME/src/fuzzdcrd/ && go mod tidy && go get github.com/dvyukov/go-fuzz/go-fuzz-dep && go get github.com/decred/dcrd/dcrec/edwards/[email protected])
for folder in $HOME/src/fuzzdcrd/fuzz_*/
do
(cd "$folder" && go-fuzz-build)
done
if [ -d $HOME/src/fuzzdcrd/ ]
then
find $HOME/src/fuzzdcrd/* -type d -not -name 'fuzz_*' -print0 | xargs -0 -I {} rm -rf {}
find $HOME/src/fuzzdcrd/* -maxdepth 0 -type f -not -name 'fuzz_*' -print0 | xargs -0 -I {} rm {}
fi