-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathout.sh
executable file
·33 lines (24 loc) · 1.03 KB
/
out.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
DST="out${BASE_PATH}" # More descriptive name
rm -rf out
for demo_path in demos/*; do
demo_name=$(basename "$demo_path")
vite_dist_dir="$demo_path/dist"
out_demo_dir="$DST/$demo_name"
if [ -d "$vite_dist_dir" ]; then
mkdir -p "$out_demo_dir"
cp -r "$vite_dist_dir"/* "$out_demo_dir"
thumbnail_file=$(find "$demo_path" -name 'thumbnail.webp' -print -quit) # Lower case for local variable
snapshot_file=$(find packages/e2e/snapshot.test.js-snapshots -name "${demo_name}-*-linux.png" -print -quit) # Lower case for local variable
if [ -n "$snapshot_file" ]; then
cp "$snapshot_file" "$out_demo_dir/thumbnail.webp"
echo "Copied snapshot_file $snapshot_file to $out_demo_dir"
elif [ -n "$thumbnail_file" ]; then
cp "$thumbnail_file" "$out_demo_dir/thumbnail.webp"
echo "Copied thumbnail_file $thumbnail_file to $out_demo_dir"
fi
echo "Copied $vite_dist_dir to $out_demo_dir"
fi
done
cp -r apps/website/out/* "$DST/"
echo "Copied apps/website/out to $DST"