Skip to content

Commit 2c8f266

Browse files
authored
Merge pull request #106 from throwaway-nolsh/main
Update BuildLinux.sh
2 parents 6ef8ef1 + df8c000 commit 2c8f266

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

BuildLinux.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
#!/bin/sh
22

3-
pwd
3+
WORKDIR="$(pwd)"
4+
echo "Working Directory: $WORKDIR"
45

5-
dotnet build --runtime linux-x64 --self-contained "$(pwd)/CTR Studio"
6-
cp -R "$(pwd)/Plugins" "$(pwd)/CTR Studio/bin/Debug/net6.0/linux-x64/"
7-
cp -R "$(pwd)/CTR Studio/bin/Debug/net6.0/Plugins" "$(pwd)/CTR Studio/bin/Debug/net6.0/linux-x64/"
6+
echo "Copying CtrLibrary into bin (else build fails)..."
7+
mkdir -p "$WORKDIR/CTR Studio/bin/Debug/net6.0/linux-x64/"
8+
cp -R "$WORKDIR/Plugins" "$WORKDIR/CTR Studio/bin/Debug/net6.0/linux-x64/"
9+
echo "Applying xcopy workaraound to CTR Studio.csproj"
10+
sed -i 's|<Exec Command="xcopy.*|<Exec Command="cp ../Plugins/CtrLibrary/bin/Debug/net6.0 ../CTR\\ Studio/bin/Debug/net6.0/Plugins -r" />|' "$WORKDIR/CTR Studio/CTR Studio.csproj"
811

9-
echo "Built CTR Studio correctly! Run './CTR\ Studio/bin/Debug/net6.0/linux-x64/CTR\ Studio' to launch!"
12+
echo "Building now..."
13+
if ! dotnet build --runtime linux-x64 --self-contained "$WORKDIR/CTR Studio"; then
14+
echo "Build failed! Please look at the errors provided and open an issue if you can't solve them."
15+
exit 1;
16+
fi
17+
18+
cp -R "$WORKDIR/CTR Studio/bin/Debug/net6.0/Plugins" "$WORKDIR/CTR Studio/bin/Debug/net6.0/linux-x64/" && echo "Success! Run './CTR\\ Studio/bin/Debug/net6.0/linux-x64/CTR\\ Studio' to launch!" || echo "Something went wrong!"

0 commit comments

Comments
 (0)