Files
VoxVera/voxvera/src/import_from_json.sh
2025-06-21 12:20:51 -04:00

22 lines
407 B
Bash

#!/bin/bash
set -euo pipefail
IMPORT_DIR="imports"
shopt -s nullglob
files=("$IMPORT_DIR"/*.json)
if [[ ${#files[@]} -eq 0 ]]; then
echo "No JSON files found in $IMPORT_DIR"
exit 0
fi
for json in "${files[@]}"; do
echo "Processing $json"
cp "$json" src/config.json
subdomain=$(jq -r '.subdomain' "$json")
dest="host/$subdomain"
rm -rf "$dest"
voxvera build --config src/config.json
done