-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathproduction.sh
More file actions
executable file
·31 lines (25 loc) · 952 Bytes
/
production.sh
File metadata and controls
executable file
·31 lines (25 loc) · 952 Bytes
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
#!/bin/bash
rm -rf build;
node --max_old_space_size=8192 ./node_modules/vite/bin/vite.js build --mode $1;
touch ./build/.nojekyll;
mkdir ./build/goals
src_dir="./build"
dest_dir="./build/goals"
# Loop through the 17 goal files
for i in {1..17}; do
# Find the HTML file with the corresponding goal number
src_file="$(find "$src_dir" -type f -iname "goal-${i}-*.html")"
src_folder="$(find "$src_dir" -type f -iname "goal-${i}-*.html" -exec basename {} .html \;)"
# If the file is found, copy it to the destination directory with the new name
if [ -n "$src_file" ]; then
# create a separate folder with an index.html:
mkdir "${src_dir}/${src_folder}"
dest_file="${src_dir}/${src_folder}/index.html"
cp "$src_file" "$dest_file"
dest_file="${dest_dir}/goal$(printf "%02d" $i).html"
cp "$src_file" "$dest_file"
echo "Copied ${src_file} to ${dest_file}"
else
echo "File for goal ${i} not found"
fi
done