#!/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 gandi_dns_update $destination=$args[0] if (!(Test-Path -Path $destination)) { New-Item -ItemType directory -Path $destination } strip target/release/gandi_dns_update # To reduce the executable size. Copy-Item target/release/gandi_dns_update -Destination $destination # Do not overwrite the configuration. if (!(Test-Path -Path $destination/config.ron)) { Copy-Item config.ron -Destination $destination } systemctl --user start gandi_dns_update