#!/usr/bin/env pwsh if ($args.Count -lt 1) { $scriptName = [Environment]::GetCommandLineArgs()[1] Write-Output "Usage: $scriptName " exit 1 } git pull cargo build --release systemctl --user stop minecraft_web $destination=$args[0] if (!(Test-Path -Path $destination)) { New-Item -ItemType directory -Path $destination } strip target/release/minecraft_web # To reduce the executable size. Copy-Item target/release/minecraft_web -Destination $destination Copy-Item backend/static -Destination $destination -Recurse -Force -Exclude style.css.map # Do not overwrite the configuration. if (!(Test-Path -Path $destination/conf.ron)) { Copy-Item backend/conf.ron -Destination $destination } systemctl --user start minecraft_web