forked from neo4j/docker-neo4j
-
Notifications
You must be signed in to change notification settings - Fork 0
/
devenv
80 lines (62 loc) · 2.28 KB
/
devenv
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# -*- mode: shell-script -*-
PATH="./build:${PATH}"
# MacOS specific checks
if [ "$(uname)" == "Darwin" ] ; then
# We use temporary directories during testing that need to be
# accessible to the Docker daemon. By default on Macs, $TMPDIR
# (which mktemp responds to) is set to a user-specific location that
# the Docker daemon cannot read from.
#
# In some environments, such as TeamCity, $TMPDIR is intentionally
# pointed elsewhere, so we only want to override the default
# value. (We don't currently run these builds on Macs, but you never
# know.) This default seems to be in /private/var/folders on some
# Macs and /var/folders on others, so we accommodate both.
if [[ "${TMPDIR}" == */var/folders* ]]; then
export TMPDIR=/tmp
fi
echo "Setting PATH with MacOS specific locations"
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/make/libexec/gnubin:$PATH"
if ! grep --version 2>/dev/null | grep -q "GNU grep" ; then
cat >&2 <<EOF
== GNU grep is required. Fix with ==
brew install grep --with-default-names
EOF
fi
if ! sed --version 2>/dev/null | grep -q "GNU sed" ; then
cat >&2 <<EOF
== GNU sed is required. Fix with ==
brew install gnu-sed
EOF
fi
if ! readlink --version 2>/dev/null | grep -q "GNU coreutils" ; then
cat >&2 <<EOF
== GNU coreutils is required. Fix with ==
brew install coreutils --with-default-names
EOF
fi
# have to use || here because BSD find doesnt even support --version (it errors)
# shellcheck disable=SC2185
find --version 1>/dev/null 2>/dev/null || cat >&2 <<EOF
== GNU findutils is required. Fix with ==
brew install findutils --with-default-names
EOF
fi # MacOS specific checks
if ! which make >/dev/null; then
if which apt-get >/dev/null; then
sudo apt-get install make
else
echo "Please install GNU Make 4.0 or later"
fi
fi
if [[ -f devenv.local ]]; then
source devenv.local
# to be consistent with the rest of neo4j we should use NEO4JVERSION exclusively but unfortunately both with and without underscore are used in this repo
export NEO4JVERSION
NEO4J_VERSION="${NEO4JVERSION}"
export NEO4J_VERSION
else
echo >&2 "Error: cannot find devenv.local"
fi