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 diff --git a/install.ps1 b/install.ps1 index 2746c7cd..9d5de659 100644 --- a/install.ps1 +++ b/install.ps1 @@ -103,8 +103,11 @@ foreach ($f in @("$HOME\.bashrc", "$HOME\.bash_profile", "$HOME\.profile")) { } } -$InstallDirPosix = $InstallDir -replace '\\', '/' -replace '^([A-Za-z]):', '/$1' -$PathLine = "export PATH=`"$InstallDirPosix:`$PATH`"" +$InstallDirPosix = $InstallDir -replace '\\', '/' +if ($InstallDirPosix -match '^([A-Za-z]):') { + $InstallDirPosix = '/' + $Matches[1].ToLower() + $InstallDirPosix.Substring(2) +} +$PathLine = "export PATH=`"${InstallDirPosix}:`$PATH`"" $NeedsUpdate = @() foreach ($f in $GitBashProfiles) { diff --git a/install.sh b/install.sh index 3e0958c0..d1e91904 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 @@ -253,14 +253,16 @@ 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). + # 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 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