-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev-path
executable file
·42 lines (37 loc) · 971 Bytes
/
dev-path
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
#!/bin/sh
#
# A small helper script to adjust the $PATH environment variable for easy
# integration of local Bro and VAST builds.
if [ -z "$1" ]; then
echo "usage: $0 [<dir> ...]"
echo ""
echo "Looks for local builds of VAST and Bro in the directories."
echo "To update your shell environment, you can use, e.g.:"
echo
echo " eval \$($0 x y z)"
echo
exit 1
fi
# Process arguments.
for dir in "$@"; do
if [ -d "$dir" ]; then
# Add VAST path.
if [ -d "$dir/vast/build" ]; then
PATH="$dir/vast/build/bin:$PATH"
fi
# Add Bro path.
if [ -d "$dir/bro/build" ]; then
PATH="$dir/bro/build/src:$PATH"
echo export BROPATH=\"$($dir/bro/build/bro-path-dev)\"
fi
fi
done
# Check for local virtual Python env.
if [ -d "$(pwd)/env/bin" ]; then
PATH="$(pwd)/env/bin:$PATH"
fi
# Check for local Broker build
if [ -d "$(pwd)/broker/build" ]; then
PATH="$(pwd)/broker/build/bin:$PATH"
fi
echo export PATH=\"$PATH\"