From 1b6ffc33a4d273c5d82174b17f63d7793f88c3fe Mon Sep 17 00:00:00 2001 From: DuProcess <273172371+DuProcess@users.noreply.github.com> Date: Thu, 16 Jul 2026 21:29:37 -0400 Subject: [PATCH] Write Windows installer config without BOM --- install.ps1 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/install.ps1 b/install.ps1 index 1d0b08b..8df2afa 100644 --- a/install.ps1 +++ b/install.ps1 @@ -345,6 +345,11 @@ function Add-UserPath($PathToAdd) { [Environment]::SetEnvironmentVariable("Path", $next, "User") } +function Write-Utf8NoBom($Path, $Content) { + $encoding = New-Object System.Text.UTF8Encoding -ArgumentList $false + [System.IO.File]::WriteAllText($Path, $Content, $encoding) +} + $bindir = Join-Path $Prefix "bin" $configDir = Join-Path $HOME ".config\dosh" New-Item -ItemType Directory -Force -Path $bindir, $configDir | Out-Null @@ -446,7 +451,7 @@ if ($ForceConfig -or -not (Test-Path $clientConfig)) { $defaultServer = if ($Server) { $Server } else { "user@example.com" } $updateRepo = if ($Repo) { $Repo } else { "https://git.palav.dev/Palav/dosh.git" } $doshHostLine = if ($DoshHost) { "dosh_host = `"$DoshHost`"" } else { "# dosh_host = `"public.example.com`"" } - @" + $clientToml = @" update_repo = "$updateRepo" update_port = $Port server = "$defaultServer" @@ -469,14 +474,15 @@ identity_files = ["~/.ssh/id_ed25519"] use_ssh_agent = true forward_agent = false escape_key = "^]" -"@ | Set-Content -NoNewline -Encoding utf8 $clientConfig +"@ + Write-Utf8NoBom $clientConfig $clientToml } $hostsConfig = Join-Path $configDir "hosts.toml" if ($ForceConfig -or -not (Test-Path $hostsConfig)) { $defaultServer = if ($Server) { $Server } else { "user@example.com" } $hostUdpLine = if ($DoshHost) { "dosh_host = `"$DoshHost`"" } else { "# dosh_host = `"server.example.com`"" } - @" + $hostsToml = @" # Example: # [server] # ssh = "server" @@ -490,7 +496,8 @@ ssh = "$defaultServer" $hostUdpLine port = $Port predict = true -"@ | Set-Content -NoNewline -Encoding utf8 $hostsConfig +"@ + Write-Utf8NoBom $hostsConfig $hostsToml } Add-UserPath $bindir