setup-app-layer.py: attempt to cd into correct directory

- If in src, cd to ..
- Error out early if the current directory does not look like a
  Suricata source directory.
pull/3487/head
Jason Ish 7 years ago committed by Victor Julien
parent 58933bafc1
commit 15922dcd8c

@ -341,6 +341,13 @@ def main():
parser = args.parser
logger = args.logger
# Make sure we are in the correct directory.
if os.path.exists("./suricata.c"):
os.chdir("..")
elif not os.path.exists("./src/suricata.c"):
raise SetupError(
"this does not appear to be a Suricata source directory.")
if parser:
if proto_exists(proto):
raise SetupError("protocol already exists: %s" % (proto))

Loading…
Cancel
Save