Added install script

This commit is contained in:
mdnapo 2024-06-02 14:17:19 +02:00
parent e3237bdabe
commit f27164e39d
3 changed files with 19 additions and 14 deletions

View File

@ -24,8 +24,4 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Folder Include="releases\" />
</ItemGroup>
</Project>

View File

@ -1,15 +1,21 @@
#!/usr/bin/bash
TARGET=$1
if [ -z "$TARGET" ]; then
echo "The target platform was not provided."
ZIP=$1
if [ -z "$ZIP" ]; then
echo "The zip file was not provided."
exit 1
fi
dotnet publish --self-contained -r linux-x64
zip -vr releases/m4g-linux.zip bin/Release/net8.0/linux-x64/
#sudo rm -rf /usr/share/m4g
#sudo cp -r bin/Release/net8.0/linux-x64 /usr/share/m4g
#sudo unlink /usr/local/bin/m4g
#sudo ln -s /usr/share/m4g/MycroForge.CLI /usr/local/bin/m4g
TARGET=${ZIP//"m4g-"/}
TARGET=${TARGET//".zip"/}
DIR="/tmp/m4g"
rm -rf "$DIR"
unzip "$ZIP" -d "$DIR"
sudo rm -rf /usr/share/m4g
sudo cp -r "$DIR/bin/Release/net8.0/$TARGET" /usr/share/m4g
sudo unlink /usr/local/bin/m4g 2> /dev/null
sudo ln -s /usr/share/m4g/MycroForge.CLI /usr/local/bin/m4g

View File

@ -17,3 +17,6 @@ The MycroForge CLI assumes a linux compatible environment, so on Windows you'll
### Install
Run the install script in the same directory as the downloaded zip. See the example below for linux-x64.
`sudo ./install.sh m4g-<platform>.zip <platform>`