This repository was archived by the owner on Mar 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy.sh
executable file
·72 lines (60 loc) · 2.3 KB
/
copy.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# Create necessary directories
mkdir -p raw/sounds
mkdir -p raw/img
# Function to copy specific files
copy_specific_files() {
local src="$1"
local dest="$2"
local type="$3"
if [ ! -d "$src" ]; then
echo "Warning: Source directory $src not found, skipping..."
return 1
fi
echo "Copying $type from $src..."
case "$type" in
"sounds")
# Define specific sound patterns to copy
patterns=(
"bgm_bossgame2" "bgm_end" "bgm_gameover" "bgm_gameover2"
"bgm_jingle1" "bgm_jingle2" "bgm_jingleBossClear" "bgm_jingleBossFailed"
"bgm_jingleBossstage" "bgm_jingleNext" "bgm_jingleSpeedUp"
"bgm_microgame1" "bgm_microgame2" "bgm_ready" "bgm_test"
"se_beam" "se_boyon2" "se_cursor" "se_decide" "se_eat"
"se_huseikai" "se_nyu2" "se_pa3" "se_poyon1" "se_poyon2"
"se_rappa" "se_seikai"
)
# Copy each required sound file
for pattern in "${patterns[@]}"; do
found_file=$(find "$src" -type f \( -name "${pattern}.wav" -o -name "${pattern}.ogg" \) -print -quit)
if [ -n "$found_file" ]; then
cp "$found_file" "$dest/"
echo "Copied: $found_file"
fi
done
;;
"textures")
# Copy from Backgrounds directory
if [ -d "$src/Backgrounds" ]; then
find "$src/Backgrounds" -type f -name "*.png" -exec cp {} "$dest/" \;
fi
# Copy from Sprites directory
if [ -d "$src/Sprites" ]; then
find "$src/Sprites" -type f -name "*.png" -exec cp {} "$dest/" \;
fi
;;
*)
echo "Unknown type: $type"
return 1
;;
esac
}
# Copy required sounds from Exported_Sounds and External_Sounds
copy_specific_files "Exported_Sounds" "raw/sounds" "sounds"
copy_specific_files "External_Sounds" "raw/sounds" "sounds"
# Copy textures from Export_Textures
copy_specific_files "Export_Textures" "raw/img" "textures"
echo "File copying complete! "
# Make the conversion scripts executable
chmod +x tools/convert_sounds.sh
chmod +x tools/convert_textures.sh