From b366019e79ec158b78b33db772a948cc9c72c758 Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Thu, 19 Mar 2026 15:56:21 +0100 Subject: [PATCH 1/6] fix: correct Windows drive letter casing and platform error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - install.ps1: lowercase drive letter in POSIX path conversion (C: → /c, not /C) - install.sh: include Windows in supported platforms error message --- install.ps1 | 2 +- install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install.ps1 b/install.ps1 index 2746c7cd..aa04dfea 100644 --- a/install.ps1 +++ b/install.ps1 @@ -103,7 +103,7 @@ foreach ($f in @("$HOME\.bashrc", "$HOME\.bash_profile", "$HOME\.profile")) { } } -$InstallDirPosix = $InstallDir -replace '\\', '/' -replace '^([A-Za-z]):', '/$1' +$InstallDirPosix = $InstallDir -replace '\\', '/' -replace '^([A-Za-z]):', { '/' + $args[0].Groups[1].Value.ToLower() } $PathLine = "export PATH=`"$InstallDirPosix:`$PATH`"" $NeedsUpdate = @() diff --git a/install.sh b/install.sh index 3e0958c0..d176e219 100644 --- a/install.sh +++ b/install.sh @@ -28,7 +28,7 @@ detect_platform() { x86_64|amd64) arch="x64" ;; *) echo "Error: unsupported architecture: $arch" >&2 - echo "archgate supports arm64 (macOS) and x64 (Linux)." >&2 + echo "archgate supports arm64 (macOS) and x64 (Linux, Windows)." >&2 exit 1 ;; esac From dfa85e89bd7d5a9b0c5985b1a851023050e2f808 Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Thu, 19 Mar 2026 18:18:52 +0100 Subject: [PATCH 2/6] fix: install script Windows fixes and CI smoke test auth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - install.ps1: lowercase drive letter in POSIX path conversion (C: → /c) - install.sh: include Windows in supported platforms error message - smoke-test.yml: pass GH_TOKEN so gh can query releases --- .github/workflows/smoke-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/smoke-test.yml b/.github/workflows/smoke-test.yml index 9000bc0a..5c2708fb 100644 --- a/.github/workflows/smoke-test.yml +++ b/.github/workflows/smoke-test.yml @@ -66,6 +66,7 @@ jobs: shell: pwsh env: ARCHGATE_VERSION: ${{ vars.LATEST_RELEASE_TAG || '' }} + GH_TOKEN: ${{ github.token }} run: | # Resolve version: use ARCHGATE_VERSION if set, otherwise query GitHub if (-not $env:ARCHGATE_VERSION) { @@ -117,6 +118,7 @@ jobs: - name: Smoke test install.sh env: ARCHGATE_VERSION: ${{ vars.LATEST_RELEASE_TAG || '' }} + GH_TOKEN: ${{ github.token }} run: | # Resolve version: use ARCHGATE_VERSION if set, otherwise query GitHub if [ -z "$ARCHGATE_VERSION" ]; then From b74c27830e8e139879dd1aec1d758e31dfe09a81 Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Thu, 19 Mar 2026 18:23:15 +0100 Subject: [PATCH 3/6] fix: delimit PowerShell variable to avoid parser error $InstallDirPosix: was parsed as a drive-qualified variable. Use ${InstallDirPosix} to delimit the variable name. --- install.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index aa04dfea..eb3a4b64 100644 --- a/install.ps1 +++ b/install.ps1 @@ -104,7 +104,7 @@ foreach ($f in @("$HOME\.bashrc", "$HOME\.bash_profile", "$HOME\.profile")) { } $InstallDirPosix = $InstallDir -replace '\\', '/' -replace '^([A-Za-z]):', { '/' + $args[0].Groups[1].Value.ToLower() } -$PathLine = "export PATH=`"$InstallDirPosix:`$PATH`"" +$PathLine = "export PATH=`"${InstallDirPosix}:`$PATH`"" $NeedsUpdate = @() foreach ($f in $GitBashProfiles) { From 78840645379e95a00bd7cbea562abfff58a16e1a Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Thu, 19 Mar 2026 18:25:20 +0100 Subject: [PATCH 4/6] fix: detect missing TTY by actually opening /dev/tty CI runners report /dev/tty as readable (-r) but fail to open it. Test with an actual fd open instead, and suppress stderr on the read to avoid noisy error messages in non-interactive environments. --- install.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index d176e219..fae2b0be 100644 --- a/install.sh +++ b/install.sh @@ -253,14 +253,17 @@ setup_path() { done echo "" - # Prompt requires /dev/tty — available even when stdin is piped (curl | sh) - if [ ! -r /dev/tty ]; then - echo "No readable TTY available. To add archgate to your PATH manually, add the lines above to your shell profile." + # Prompt requires /dev/tty — available even when stdin is piped (curl | sh). + # Test with an actual open, not just -r, because CI runners may report it as + # readable yet fail to open it (no controlling terminal). + if ! exec 3/dev/null; then + echo "No TTY available. To add archgate to your PATH manually, add the lines above to your shell profile." return fi + exec 3<&- printf "Update these files now? [Y/n] " - if ! read -r answer /dev/null; then echo "" echo "Could not read from terminal. To add archgate to your PATH manually, add the lines above to your shell profile." return From 6cf32bc1cf5edc5a157ca988326c0e22becc4544 Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Thu, 19 Mar 2026 18:27:21 +0100 Subject: [PATCH 5/6] fix: use compatible PowerShell syntax for drive letter lowercasing The -replace script block syntax requires PowerShell 6+ and the $args automatic variable behaves differently across versions. Use -match with $Matches instead for cross-version compatibility. --- install.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/install.ps1 b/install.ps1 index eb3a4b64..9d5de659 100644 --- a/install.ps1 +++ b/install.ps1 @@ -103,7 +103,10 @@ foreach ($f in @("$HOME\.bashrc", "$HOME\.bash_profile", "$HOME\.profile")) { } } -$InstallDirPosix = $InstallDir -replace '\\', '/' -replace '^([A-Za-z]):', { '/' + $args[0].Groups[1].Value.ToLower() } +$InstallDirPosix = $InstallDir -replace '\\', '/' +if ($InstallDirPosix -match '^([A-Za-z]):') { + $InstallDirPosix = '/' + $Matches[1].ToLower() + $InstallDirPosix.Substring(2) +} $PathLine = "export PATH=`"${InstallDirPosix}:`$PATH`"" $NeedsUpdate = @() From ecf5cf6b052048d0061107837bfbd8bd173efc2b Mon Sep 17 00:00:00 2001 From: Rhuan Barreto Date: Thu, 19 Mar 2026 18:28:34 +0100 Subject: [PATCH 6/6] fix: test /dev/tty in a subshell to avoid aborting the script exec redirect failures are fatal in sh and cannot be caught by if. Use a subshell (exec /dev/null; then + # Use a subshell to test the actual open, because -r may pass on CI runners + # that have /dev/tty present but no controlling terminal. + if ! (exec /dev/null; then echo "No TTY available. To add archgate to your PATH manually, add the lines above to your shell profile." return fi - exec 3<&- printf "Update these files now? [Y/n] " if ! read -r answer /dev/null; then