preflight.sh (view raw)
1set -e
2
3go version > /dev/null 2>&1 || (echo go 1.18+ is required && false)
4
5v=`go version | egrep -o "go1\.[^.]+"` || echo failed to identify go version
6if [ "$v" \< "go1.18" ] ; then
7 echo go version is too old: $v
8 echo go 1.18+ is required
9 false
10fi
11
12sqlhdr=
13if [ `uname` = "Darwin" ] ; then
14 : # okay
15else
16 if [ -e /usr/include/sqlite3.h ] ; then
17 sqlhdr=/usr/include/sqlite3.h
18 elif [ -e /usr/local/include/sqlite3.h ] ; then
19 sqlhdr=/usr/local/include/sqlite3.h
20 else
21 echo unable to find sqlite3.h header
22 echo please install libsqlite3 dev package
23 false
24 fi
25 sqlvers=`grep "#define SQLITE_VERSION_NUMBER" $sqlhdr | cut -f3 -d' '`
26 if [ $sqlvers -lt 3034000 ] ; then
27 echo sqlite3.h header is too old: $sqlvers
28 echo version 3.34.0+ is required
29 false
30 fi
31fi
32
33touch .preflightcheck