generated from Fortunevale/ProjectMakoto.Plugins.Example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.build.sh
61 lines (48 loc) · 1.34 KB
/
.build.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
#!/bin/bash
# User-definable variables
PluginDir="/path/to/plugin/directory"
PluginName="ProjectMakoto.Plugins.ScoreSaber"
# Build procedure, leave alone
CurrDirName=$(basename "$(pwd)")
echo "Deleting conflicting files.."
rm -f build.zip
rm -f "${CurrDirName}.pmpl"
rm -rf bin
rm -rf build
echo "Building project.."
dotnet clean
dotnet restore
dotnet publish "${PluginName}.sln" --property:PublishDir="build" --framework net9.0
if [ $? -ne 0 ]; then
echo "Error: Build failed."
exit 1
fi
echo "Zipping project to build.zip.."
dotnet run --project "Tools/CreateZipFolder/CreateZipFolder.csproj" -- "build" "build.zip"
if [ $? -ne 0 ]; then
echo "Error: Zipping failed."
exit 1
fi
mv build.zip "${CurrDirName}.pmpl"
echo "Creating manifest.."
current_dir=$(pwd)
cd ../deps
dotnet ProjectMakoto.dll --build-manifests $current_dir
cd $current_dir
echo -e "\n\nCreated pmpl-File at $(pwd)/${CurrDirName}.pmpl!"
echo "Cleaning up.."
rm -rf bin
rm -rf build
if [ "$PluginDir" = "/path/to/plugin/directory" ]; then
echo -e "\nTip: You can define an output directory in this file by replacing PluginDir with the appropriate path."
exit 0
fi
echo -e "\nCopying to $PluginDir.."
rm -f "${PluginDir}/${CurrDirName}.pmpl"
sleep 1
mv "${CurrDirName}.pmpl" "${PluginDir}/${CurrDirName}.pmpl"
if [ $? -ne 0 ]; then
echo "Error: Copying failed."
exit 1
fi
exit 0