#!/bin/bash
# 依赖安全审计脚本
# 用法: ./scripts/audit.sh

set -e

echo "Running npm audit..."
npm audit --audit-level=moderate
EXIT_CODE=$?

if [ $EXIT_CODE -ne 0 ]; then
  echo "Security vulnerabilities found!"
  npm audit --json > audit-report.json
  exit $EXIT_CODE
fi

echo "No vulnerabilities found."
