#!/bin/sh
echo "Pre-commit: Testing for security issues ..."

# -z tells glue to emit error on warnings
# -v mount volumes
# -l code stage
docker run --name="glue-precommit" --rm=true -v /Users/mk/line/tmp/triage/:/tmp/triage/ owasp/glue:0.9.0 -z -l code /tmp/triage/
RESULT=$?
if [$RESULT -eq 0]
then
    echo "pre-commit: No detected security errors \o/"
    exit 0
else
    echo "pre-commit: Aborting commit due to security errors"
    echo "3 suggests security warning. 127 suggests failure to run."
    exit $RESULT
fi
