From bcf82614e6dbe2701e28b52d95a982f5a39cacce Mon Sep 17 00:00:00 2001 From: Arnab Chakraborty <11457760+Rocky43007@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:57:01 +0300 Subject: [PATCH] Scripts switching prod and dev service endpoints A script that switches the prod and dev endpoints for the auth & relay services. --- scripts/switch_servers.ps1 | 163 +++++++++++++++++++++++++++++++++++++ scripts/switch_servers.sh | 113 +++++++++++++++++++++++++ 2 files changed, 276 insertions(+) create mode 100644 scripts/switch_servers.ps1 create mode 100755 scripts/switch_servers.sh diff --git a/scripts/switch_servers.ps1 b/scripts/switch_servers.ps1 new file mode 100644 index 000000000..e8169fe09 --- /dev/null +++ b/scripts/switch_servers.ps1 @@ -0,0 +1,163 @@ +# Usage +# .\script.ps1 dev # Will prompt for relay server modification +# .\script.ps1 prod # Will prompt for relay server modification +# .\script.ps1 dev -r # Will automatically modify relay servers +# .\script.ps1 prod -r # Will automatically modify relay servers +# .\script.ps1 dev -s # Will skip relay server modification without prompting +# .\script.ps1 prod -s # Will skip relay server modification without prompting + + +# File paths +$rustFile = "core/crates/cloud-services/src/lib.rs" +$tsxFile = "interface/util/index.tsx" +$coreFile = "core/src/lib.rs" + +# Function to prompt for relay servers change +function Prompt-RelayServers { + while ($true) { + $response = Read-Host "Do you want to modify relay servers as well? (y/n)" + switch ($response.ToLower()) { + 'y' { return $true } + 'n' { return $false } + default { Write-Host "Please answer y or n." } + } + } +} + +# Check arguments +if ($args.Count -lt 1 -or $args.Count -gt 2) { + Write-Host "Usage: