Files
swarm/repomix-safe.sh
2025-11-19 11:49:26 +00:00

32 lines
490 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)"
TMP_DIR="$(mktemp -d -t repomix-safe-XXXXXX)"
cleanup() {
rm -rf "$TMP_DIR"
}
trap cleanup EXIT INT TERM
cd "$ROOT_DIR"
SAFE_ITEMS=(
"compose"
"traefik"
"docker-compose.yml"
"repomix.config.json"
".repomixignore"
)
for item in "${SAFE_ITEMS[@]}"; do
if [[ -e "$item" ]]; then
rsync -a "$item" "$TMP_DIR"/
fi
done
(
cd "$TMP_DIR"
repomix --no-security-check "$@"
)