-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathGenerate Release.bash
More file actions
43 lines (33 loc) · 1.15 KB
/
Generate Release.bash
File metadata and controls
43 lines (33 loc) · 1.15 KB
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
#!/usr/bin/env bash
run_dir=$(cd "$(dirname "$0")" && pwd)
cd "$run_dir" || exit
echo "Deleting existing release."
rm -rf "../release"
echo "Creating new release directory."
mkdir -p "../release/zip"
echo "Searching for plugins."
for plugin_dir in ../src/plugin/*; do
if [ -d "$plugin_dir" ]; then
plugin_name=$(basename "$plugin_dir")
if [ "$plugin_name" == "curationclub" ]; then
echo "Skipping $plugin_name."
continue
fi
echo "Creating release for $plugin_name."
mkdir -p "../release/$plugin_name/"{base,common,plugin}
echo "Copying plugin files into release."
cd "../"
rsync -ar "src/plugin/$plugin_name/" "release/$plugin_name/plugin/$plugin_name/"
rsync -ar "src/base/" "release/$plugin_name/base/"
rsync -ar "src/common/" "release/$plugin_name/common/"
rsync -ar "src/${plugin_name}_init.py" "release/$plugin_name/"
cd "$run_dir" || exit
echo "Renaming plugin init file."
cd "../release/$plugin_name" || exit
mv "${plugin_name}_init.py" "__init__.py"
echo "Zipping released mods."
echo "Zipping $plugin_name."
cd "../"
zip -r "zip/$plugin_name.zip" "$plugin_name"
fi
done