From 84597241e0636c7b56ae88167940b029680784e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Tue, 26 Aug 2014 23:32:27 +0200 Subject: [PATCH] Exit when pkg-config isn't found We run pkg-config in a subshell, so our 'set -e' does not take effect there. Explicitly error out if there was an error running pkg-config. --- script/with-static.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/with-static.sh b/script/with-static.sh index 0caed5e..3f60e31 100755 --- a/script/with-static.sh +++ b/script/with-static.sh @@ -5,7 +5,8 @@ set -ex export BUILD="$PWD/vendor/libgit2/build" export PCFILE="$BUILD/libgit2.pc" -export CGO_LDFLAGS="$BUILD/libgit2.a -L$BUILD $(pkg-config --static --libs $PCFILE)" +FLAGS=$(pkg-config --static --libs $PCFILE) || exit 1 +export CGO_LDFLAGS="$BUILD/libgit2.a -L$BUILD ${FLAGS}" export CGO_CFLAGS="-I$PWD/vendor/libgit2/include" $@