mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 11:03:59 +00:00
- Introduce lib/shell helpers and keep etc/* scripts thin via compatibility shims - Move Kerberos validation to scripts/validation/check_kerberos.sh and update callers - Add deterministic shellspec unit tests under tests/shellspec/ and wire Maven to run them - Add minimal Spring Boot authority module with startup + /health endpoint and Maven wiring - Document the new layout in docs/layout.md Co-authored-by: Junie <junie@jetbrains.com>
43 lines
1.4 KiB
Bash
Executable File
43 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
ROOT_DIR=$(cd "$SCRIPT_DIR/../.." && pwd)
|
|
|
|
SHELLSPEC_VERSION="0.28.1"
|
|
VENDOR_DIR="$SCRIPT_DIR/.vendor"
|
|
ARCHIVE="$VENDOR_DIR/shellspec-${SHELLSPEC_VERSION}.tar.gz"
|
|
EXTRACT_DIR="$VENDOR_DIR/shellspec-${SHELLSPEC_VERSION}"
|
|
|
|
mkdir -p "$VENDOR_DIR"
|
|
|
|
if command -v shellspec >/dev/null 2>&1; then
|
|
SHELLSPEC_BIN="shellspec"
|
|
else
|
|
if [[ ! -d "$EXTRACT_DIR" ]]; then
|
|
if [[ ! -f "$ARCHIVE" ]]; then
|
|
# GitHub tags may be either `v<version>` or `<version>`.
|
|
curl -fsSL "https://github.com/shellspec/shellspec/archive/refs/tags/v${SHELLSPEC_VERSION}.tar.gz" -o "$ARCHIVE" \
|
|
|| curl -fsSL "https://github.com/shellspec/shellspec/archive/refs/tags/${SHELLSPEC_VERSION}.tar.gz" -o "$ARCHIVE"
|
|
fi
|
|
tar -xzf "$ARCHIVE" -C "$VENDOR_DIR"
|
|
|
|
extracted_dir=""
|
|
if [[ -d "$VENDOR_DIR/shellspec-${SHELLSPEC_VERSION}" ]]; then
|
|
extracted_dir="$VENDOR_DIR/shellspec-${SHELLSPEC_VERSION}"
|
|
elif [[ -d "$VENDOR_DIR/shellspec-v${SHELLSPEC_VERSION}" ]]; then
|
|
extracted_dir="$VENDOR_DIR/shellspec-v${SHELLSPEC_VERSION}"
|
|
fi
|
|
|
|
if [[ -n "$extracted_dir" && "$extracted_dir" != "$EXTRACT_DIR" ]]; then
|
|
mv "$extracted_dir" "$EXTRACT_DIR"
|
|
fi
|
|
fi
|
|
|
|
SHELLSPEC_BIN="$EXTRACT_DIR/shellspec"
|
|
fi
|
|
|
|
cd "$ROOT_DIR"
|
|
exec "$SHELLSPEC_BIN" --shell bash "$ROOT_DIR/tests/shellspec/spec" "$@"
|