|
1
|
#!/bin/bash |
|
2
|
# Verify all source directories were copied to the artifact. |
|
3
|
# Usage: bash expo_verify_copy.sh <app-name> <prefix> |
|
4
|
|
|
5
|
set -euo pipefail |
|
6
|
|
|
7
|
if [ $# -lt 2 ]; then |
|
8
|
echo "Usage: bash expo_verify_copy.sh <app-name> <prefix>" |
|
9
|
exit 1 |
|
10
|
fi |
|
11
|
|
|
12
|
APP="$1" |
|
13
|
PREFIX="$2" |
|
14
|
MISSING=0 |
|
15
|
|
|
16
|
# Skip directories that are migrated elsewhere (not into the expo artifact): |
|
17
|
# node_modules — not copied |
|
18
|
# server/ — migrated to artifacts/api-server (Phase 2) |
|
19
|
# shared/ — migrated to lib/db (Phase 2) |
|
20
|
SKIP_DIRS="node_modules server shared" |
|
21
|
|
|
22
|
for dir in .migration-backup/"$PREFIX"/*/; do |
|
23
|
[ ! -d "$dir" ] && continue |
|
24
|
name=$(basename "$dir") |
|
25
|
echo "$SKIP_DIRS" | grep -qw "$name" && continue |
|
26
|
if [ ! -d "artifacts/$APP/$name" ]; then |
|
27
|
echo "WARNING: $name was NOT copied" |
|
28
|
MISSING=1 |
|
29
|
fi |
|
30
|
done |
|
31
|
|
|
32
|
if [ $MISSING -ne 0 ]; then |
|
33
|
echo "Fix missing directories before proceeding." |
|
34
|
exit 1 |
|
35
|
else |
|
36
|
echo "All source directories copied." |
|
37
|
fi |