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> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="releases\" />
</ItemGroup>
</Project> </Project>

View File

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