checkpoint: pre-audit baseline state
This commit is contained in:
55
scripts/build-local-backend-zip.sh
Executable file
55
scripts/build-local-backend-zip.sh
Executable file
@@ -0,0 +1,55 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Build a clean distributable ZIP for Local Backend package.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/build-local-backend-zip.sh
|
||||
# ./scripts/build-local-backend-zip.sh /path/to/source /path/to/output.zip
|
||||
|
||||
SOURCE_DIR="${1:-/Users/dwindown/Documents/agentic-writer-local-backend}"
|
||||
OUTPUT_ZIP="${2:-/private/tmp/agentic-writer-local-backend.zip}"
|
||||
|
||||
if [[ ! -d "$SOURCE_DIR" ]]; then
|
||||
echo "Source directory not found: $SOURCE_DIR" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v zip >/dev/null 2>&1; then
|
||||
echo "'zip' command is required but not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TMP_DIR="$(mktemp -d)"
|
||||
trap 'rm -rf "$TMP_DIR"' EXIT
|
||||
|
||||
PKG_DIR="$TMP_DIR/agentic-writer-local-backend"
|
||||
mkdir -p "$PKG_DIR"
|
||||
|
||||
# Copy only distributable files/directories (exclude runtime/build/noise files).
|
||||
rsync -a \
|
||||
--exclude '.git/' \
|
||||
--exclude '.github/' \
|
||||
--exclude '.claude/' \
|
||||
--exclude '.sixth/' \
|
||||
--exclude 'node_modules/' \
|
||||
--exclude '.env' \
|
||||
--exclude '.env.*' \
|
||||
--exclude '*.log' \
|
||||
--exclude 'logs/' \
|
||||
--exclude '.DS_Store' \
|
||||
--exclude '__MACOSX/' \
|
||||
--exclude '*.zip' \
|
||||
"$SOURCE_DIR/" "$PKG_DIR/"
|
||||
|
||||
mkdir -p "$(dirname "$OUTPUT_ZIP")"
|
||||
rm -f "$OUTPUT_ZIP"
|
||||
|
||||
(
|
||||
cd "$TMP_DIR"
|
||||
zip -r "$OUTPUT_ZIP" "agentic-writer-local-backend" >/dev/null
|
||||
)
|
||||
|
||||
echo "Built package:"
|
||||
echo " Source: $SOURCE_DIR"
|
||||
echo " Output: $OUTPUT_ZIP"
|
||||
Reference in New Issue
Block a user