From d03c3e95271e35997ced986eef938ba4e862fcfc Mon Sep 17 00:00:00 2001 From: "@zimeg" Date: Mon, 15 Dec 2025 16:16:23 -0800 Subject: [PATCH 01/22] fix: gather version for windows installation from latest releases metadata --- scripts/install-windows-dev.ps1 | 2 +- scripts/install-windows.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-windows-dev.ps1 b/scripts/install-windows-dev.ps1 index b533936..9d3abe1 100644 --- a/scripts/install-windows-dev.ps1 +++ b/scripts/install-windows-dev.ps1 @@ -109,7 +109,7 @@ function install_slack_cli { else { Write-Host "Finding the latest Slack CLI release version" $cli_info = Invoke-RestMethod -Uri "https://docs.slack.dev/tools/metadata.json" - $SLACK_CLI_VERSION = $cli_info.'slack-cli'.releases.version[0] + $SLACK_CLI_VERSION = $cli_info.'slack-cli'.releases[0].version } } catch { diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index d89525f..dbd7dc2 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -106,7 +106,7 @@ function install_slack_cli { else { Write-Host "Finding the latest Slack CLI release version" $cli_info = Invoke-RestMethod -Uri "https://docs.slack.dev/tools/metadata.json" - $SLACK_CLI_VERSION = $cli_info.'slack-cli'.releases.version[0] + $SLACK_CLI_VERSION = $cli_info.'slack-cli'.releases[0].version } } catch { From 6f8820fc73df35ab9ca583e4741fb80ae12bf3fc Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 10:06:27 -0800 Subject: [PATCH 02/22] test: confirm unix and windows machines install shell scripts --- .github/workflows/tests.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c2c3360..2fd326c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,6 +42,29 @@ jobs: files: ./coverage.out fail_ci_if_error: false + install: + name: Install + strategy: + matrix: + include: + - os: ubuntu-latest + script: ./scripts/install.sh + shell: bash + - os: windows-latest + script: ./scripts/install-windows.ps1 + shell: pwsh + runs-on: ${{ matrix.os }} + permissions: + contents: read + steps: + - name: Checkout the latest changes + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + - name: Attempt the installation + shell: ${{ matrix.shell }} + run: ${{ matrix.script }} + # Monitor code coverage and TODO/FIXME-type comments health-score: name: Health Score From f9628c4ef23689b76a265816334534a3e8876a84 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 10:08:09 -0800 Subject: [PATCH 03/22] test(fix): prefer default shell for operating systems runner --- .github/workflows/tests.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2fd326c..5cf70a2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,10 +49,8 @@ jobs: include: - os: ubuntu-latest script: ./scripts/install.sh - shell: bash - os: windows-latest script: ./scripts/install-windows.ps1 - shell: pwsh runs-on: ${{ matrix.os }} permissions: contents: read @@ -62,7 +60,6 @@ jobs: with: persist-credentials: false - name: Attempt the installation - shell: ${{ matrix.shell }} run: ${{ matrix.script }} # Monitor code coverage and TODO/FIXME-type comments From c0390277d1b6afa56fd2e26e3cb2247a26e23419 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 10:26:47 -0800 Subject: [PATCH 04/22] ci: make installation scripts explicit for test outcome --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5cf70a2..18c87c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,9 +48,9 @@ jobs: matrix: include: - os: ubuntu-latest - script: ./scripts/install.sh + script: bash ./scripts/install.sh - os: windows-latest - script: ./scripts/install-windows.ps1 + script: pwsh -NoProfile -NonInteractive -File ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: contents: read From 57784eb5495a0b8398846c240bc647f19de02b45 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 10:30:27 -0800 Subject: [PATCH 05/22] ci: attempt a joined script for windows installation command --- .github/workflows/tests.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 18c87c6..00c806c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,9 +48,10 @@ jobs: matrix: include: - os: ubuntu-latest - script: bash ./scripts/install.sh + script: ./scripts/install.sh - os: windows-latest - script: pwsh -NoProfile -NonInteractive -File ./scripts/install-windows.ps1 + script: | + & ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: contents: read From 4cb5f4402d278c3cc346907ba3adb1be04946afa Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 14:44:28 -0800 Subject: [PATCH 06/22] ci: configure the installation path for fingerprinting without profile for windows --- .github/workflows/tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 00c806c..7f747c8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,10 +48,11 @@ jobs: matrix: include: - os: ubuntu-latest + path: echo "$HOME/.slack/bin" >> "$GITHUB_PATH" script: ./scripts/install.sh - os: windows-latest - script: | - & ./scripts/install-windows.ps1 + path: Add-Content -Path $env:GITHUB_PATH -Value "$env:USERPROFILE\.slack\bin" + script: ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: contents: read @@ -60,6 +61,8 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false + - name: Configure the path + run: ${{ matrix.path }} - name: Attempt the installation run: ${{ matrix.script }} From a12674604dfc47a39430a06a2f9b34a7d8952c23 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 14:46:33 -0800 Subject: [PATCH 07/22] ci: invoke the script using an explicit shell command --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f747c8..9b7c60b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,10 +49,10 @@ jobs: include: - os: ubuntu-latest path: echo "$HOME/.slack/bin" >> "$GITHUB_PATH" - script: ./scripts/install.sh + script: pwsh ./scripts/install.sh - os: windows-latest path: Add-Content -Path $env:GITHUB_PATH -Value "$env:USERPROFILE\.slack\bin" - script: ./scripts/install-windows.ps1 + script: bash ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: contents: read From 3fb5b7bb3989b999a01e42acfd8f57186a726002 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 14:47:34 -0800 Subject: [PATCH 08/22] fix: use the correct shell for each operating setup --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b7c60b..2cee46f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,10 +49,10 @@ jobs: include: - os: ubuntu-latest path: echo "$HOME/.slack/bin" >> "$GITHUB_PATH" - script: pwsh ./scripts/install.sh + script: bash ./scripts/install.sh - os: windows-latest path: Add-Content -Path $env:GITHUB_PATH -Value "$env:USERPROFILE\.slack\bin" - script: bash ./scripts/install-windows.ps1 + script: pwsh ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: contents: read From d1eab43f7e8ec8b1a29f27c75d5ffa7a8ac8d356 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 14:54:00 -0800 Subject: [PATCH 09/22] temp: log outputs in the installation script to troubleshoot --- scripts/install-windows.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index dbd7dc2..a99e27d 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -258,6 +258,8 @@ install_slack_cli $Alias $Version Write-Host "`nAdding developer tooling for an enhanced experience..." install_git $SkipGit Write-Host "Sweet! You're all set to start developing!" +Write-Host "test: $Alias xox" +& $Alias _fingerprint terms_of_service $Alias feedback_message $Alias next_step_message $Alias From 4d6ebe436663d0e3f77c139ef5a50c4baea7c296 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 14:56:23 -0800 Subject: [PATCH 10/22] temp: output an alias variable multiple times with casings --- scripts/install-windows.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index a99e27d..1d28444 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -46,6 +46,8 @@ function check_slack_binary_exist() { ) $FINGERPRINT = "d41d8cd98f00b204e9800998ecf8427e" $SLACK_CLI_NAME = "slack" + Write-Host "xd1: $alias" + Write-Host "xd2: $Alias" if ($alias) { $SLACK_CLI_NAME = $alias } @@ -258,8 +260,8 @@ install_slack_cli $Alias $Version Write-Host "`nAdding developer tooling for an enhanced experience..." install_git $SkipGit Write-Host "Sweet! You're all set to start developing!" -Write-Host "test: $Alias xox" -& $Alias _fingerprint +# Write-Host "test: $Alias xox" +# & $Alias _fingerprint terms_of_service $Alias feedback_message $Alias next_step_message $Alias From c9e3a29b3370ec23e8829e725465de5096f7080e Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 14:59:03 -0800 Subject: [PATCH 11/22] ci: print aliases and attempt the fingerprintings --- scripts/install-windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 1d28444..3a761a5 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -51,6 +51,8 @@ function check_slack_binary_exist() { if ($alias) { $SLACK_CLI_NAME = $alias } + Write-Host "xd3: $SLACK_CLI_NAME" + & $SLACK_CLI_NAME _fingerprint if (Get-Command $SLACK_CLI_NAME -ErrorAction SilentlyContinue) { if ($Diagnostics) { delay 0.3 "Checking if ``$SLACK_CLI_NAME`` already exists on this system..." @@ -260,8 +262,6 @@ install_slack_cli $Alias $Version Write-Host "`nAdding developer tooling for an enhanced experience..." install_git $SkipGit Write-Host "Sweet! You're all set to start developing!" -# Write-Host "test: $Alias xox" -# & $Alias _fingerprint terms_of_service $Alias feedback_message $Alias next_step_message $Alias From 693ad8b2f8659398838d22288459f1fcbd5d2e6b Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 15:13:18 -0800 Subject: [PATCH 12/22] temp: what is the fingerprint doing in ci lets find out --- .github/workflows/tests.yml | 12 ++++++------ scripts/install-windows.ps1 | 11 ++++++++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2cee46f..79d9717 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,11 +48,11 @@ jobs: matrix: include: - os: ubuntu-latest - path: echo "$HOME/.slack/bin" >> "$GITHUB_PATH" - script: bash ./scripts/install.sh + # path: echo "$HOME/.slack/bin" >> "$GITHUB_PATH" + script: ./scripts/install.sh - os: windows-latest - path: Add-Content -Path $env:GITHUB_PATH -Value "$env:USERPROFILE\.slack\bin" - script: pwsh ./scripts/install-windows.ps1 + # path: Add-Content -Path $env:GITHUB_PATH -Value "$env:USERPROFILE\.slack\bin" + script: ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: contents: read @@ -61,8 +61,8 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - - name: Configure the path - run: ${{ matrix.path }} + # - name: Configure the path + # run: ${{ matrix.path }} - name: Attempt the installation run: ${{ matrix.script }} diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 3a761a5..385b720 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -52,7 +52,7 @@ function check_slack_binary_exist() { $SLACK_CLI_NAME = $alias } Write-Host "xd3: $SLACK_CLI_NAME" - & $SLACK_CLI_NAME _fingerprint + # & $SLACK_CLI_NAME _fingerprint if (Get-Command $SLACK_CLI_NAME -ErrorAction SilentlyContinue) { if ($Diagnostics) { delay 0.3 "Checking if ``$SLACK_CLI_NAME`` already exists on this system..." @@ -167,6 +167,15 @@ function install_slack_cli { [System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User) $Env:Path = $Env:Path.TrimEnd(';') + ";$slack_cli_bin_dir" } + + $old = $ErrorActionPreference + $ErrorActionPreference = 'Continue' + try { + $fp = (& $SLACK_CLI_NAME _fingerprint 2>&1 | Out-String).Trim() + } finally { + $ErrorActionPreference = $old + } + Remove-Item "$($slack_cli_dir)\slack_cli.zip" } From 5e0293c4e2d192a8f7bab4c18baf453b617e0abe Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 15:16:07 -0800 Subject: [PATCH 13/22] ci: log more to test because it is confusing to me right now --- scripts/install-windows.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 385b720..c99139c 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -172,6 +172,7 @@ function install_slack_cli { $ErrorActionPreference = 'Continue' try { $fp = (& $SLACK_CLI_NAME _fingerprint 2>&1 | Out-String).Trim() + Write-Host "nooo $fp" } finally { $ErrorActionPreference = $old } @@ -264,6 +265,9 @@ function next_step_message { trap { Write-Host "`nWe would love to know how things are going. Really. All of it." Write-Host "Submit installation issues: https://github.com/slackapi/slack-cli/issues" + + + $_ | Format-List * | Out-String | Write-Host exit 1 } From 4636e0f7f815dc4162f3076b1a275f4c2c637c4b Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 15:19:01 -0800 Subject: [PATCH 14/22] ci: use a confirmed alias not another variable --- scripts/install-windows.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index c99139c..855874f 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -171,7 +171,7 @@ function install_slack_cli { $old = $ErrorActionPreference $ErrorActionPreference = 'Continue' try { - $fp = (& $SLACK_CLI_NAME _fingerprint 2>&1 | Out-String).Trim() + $fp = (& $confirmed_alias _fingerprint 2>&1 | Out-String).Trim() Write-Host "nooo $fp" } finally { $ErrorActionPreference = $old From f266322d5c547e7b2aa3213076b4ac7f09f4506b Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 15:30:03 -0800 Subject: [PATCH 15/22] fix: output without exiting error and diagnostics more often --- scripts/install-windows.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 855874f..a7f3cde 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -59,9 +59,9 @@ function check_slack_binary_exist() { delay 0.2 "Heads up! A binary called ``$SLACK_CLI_NAME`` was found!" delay 0.3 "Now checking if it's the same Slack CLI..." } - & $SLACK_CLI_NAME _fingerprint | Tee-Object -Variable get_finger_print | Out-Null + $get_finger_print = (& $SLACK_CLI_NAME _fingerprint 2>&1 | Out-String).Trim() if ($get_finger_print -ne $FINGERPRINT) { - & $SLACK_CLI_NAME --version | Tee-Object -Variable slack_cli_version | Out-Null + $slack_cli_version = (& $SLACK_CLI_NAME --version 2>&1 | Out-String) if (!($slack_cli_version -contains "Using ${SLACK_CLI_NAME}.exe v")) { Write-Host "Error: Your existing ``$SLACK_CLI_NAME`` command is different from this Slack CLI!" Write-Host "Halting the install to avoid accidentally overwriting it." @@ -223,7 +223,7 @@ function terms_of_service { [Parameter(HelpMessage = "Alias of Slack CLI")] [string]$Alias ) - $confirmed_alias = check_slack_binary_exist $Alias $Version $false + $confirmed_alias = check_slack_binary_exist $Alias $Version $true if (Get-Command $confirmed_alias) { Write-Host "`nUse of the Slack CLI should comply with the Slack API Terms of Service:" Write-Host " https://slack.com/terms-of-service/api" From 82ac7c5111bce206b8f9956553026fd75ba268a3 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 15:32:48 -0800 Subject: [PATCH 16/22] ci: setup custom shells for different workflow runs --- .github/workflows/tests.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 79d9717..c87b80c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,10 +48,8 @@ jobs: matrix: include: - os: ubuntu-latest - # path: echo "$HOME/.slack/bin" >> "$GITHUB_PATH" script: ./scripts/install.sh - os: windows-latest - # path: Add-Content -Path $env:GITHUB_PATH -Value "$env:USERPROFILE\.slack\bin" script: ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: @@ -61,10 +59,17 @@ jobs: uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: persist-credentials: false - # - name: Configure the path - # run: ${{ matrix.path }} - - name: Attempt the installation - run: ${{ matrix.script }} + - name: Attempt the installation (Unix) + if: runner.os == 'Linux' + shell: bash + run: | + set -euo pipefail + ${{ matrix.script }} + - name: Attempt the installation (Windows) + if: runner.os == 'Windows' + shell: pwsh -NoProfile -NonInteractive + run: | + & ${{ matrix.script }} # Monitor code coverage and TODO/FIXME-type comments health-score: From 7fc18006ddad5af9cc52a9716596bd1f0eafe5a7 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 15:35:37 -0800 Subject: [PATCH 17/22] ci: invoke scripts direct inline without matrix setup --- .github/workflows/tests.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c87b80c..99db9b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -48,9 +48,7 @@ jobs: matrix: include: - os: ubuntu-latest - script: ./scripts/install.sh - os: windows-latest - script: ./scripts/install-windows.ps1 runs-on: ${{ matrix.os }} permissions: contents: read @@ -64,12 +62,12 @@ jobs: shell: bash run: | set -euo pipefail - ${{ matrix.script }} + bash ./scripts/install.sh - name: Attempt the installation (Windows) if: runner.os == 'Windows' - shell: pwsh -NoProfile -NonInteractive + shell: pwsh run: | - & ${{ matrix.script }} + pwsh -NoProfile -NonInteractive -File ./scripts/install-windows.ps1 # Monitor code coverage and TODO/FIXME-type comments health-score: From 85b2b751782f0dc6bb9115ff5251a998472ef08a Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 15:46:41 -0800 Subject: [PATCH 18/22] fix: skip interactive additions to the path from claude suggestion --- .github/workflows/tests.yml | 6 ++++-- scripts/install-windows.ps1 | 22 ++++++++-------------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 99db9b4..a8499f1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -62,12 +62,14 @@ jobs: shell: bash run: | set -euo pipefail - bash ./scripts/install.sh + ./scripts/install.sh - name: Attempt the installation (Windows) if: runner.os == 'Windows' shell: pwsh run: | - pwsh -NoProfile -NonInteractive -File ./scripts/install-windows.ps1 + & ./scripts/install-windows.ps1 + - name: Confirm the version exists + run: slack --version # Monitor code coverage and TODO/FIXME-type comments health-score: diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index a7f3cde..89825ac 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -46,13 +46,9 @@ function check_slack_binary_exist() { ) $FINGERPRINT = "d41d8cd98f00b204e9800998ecf8427e" $SLACK_CLI_NAME = "slack" - Write-Host "xd1: $alias" - Write-Host "xd2: $Alias" if ($alias) { $SLACK_CLI_NAME = $alias } - Write-Host "xd3: $SLACK_CLI_NAME" - # & $SLACK_CLI_NAME _fingerprint if (Get-Command $SLACK_CLI_NAME -ErrorAction SilentlyContinue) { if ($Diagnostics) { delay 0.3 "Checking if ``$SLACK_CLI_NAME`` already exists on this system..." @@ -164,19 +160,17 @@ function install_slack_cli { $Path = [System.Environment]::GetEnvironmentVariable('Path', $User) if (!(";${Path};".ToLower() -like "*;${slack_cli_bin_dir};*".ToLower())) { Write-Host "Adding ``$confirmed_alias.exe`` to your Path environment variable" - [System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User) + if ([Environment]::UserInteractive) { + try { + [System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User) + } + catch { + # Silently continue if SetEnvironmentVariable fails + } + } $Env:Path = $Env:Path.TrimEnd(';') + ";$slack_cli_bin_dir" } - $old = $ErrorActionPreference - $ErrorActionPreference = 'Continue' - try { - $fp = (& $confirmed_alias _fingerprint 2>&1 | Out-String).Trim() - Write-Host "nooo $fp" - } finally { - $ErrorActionPreference = $old - } - Remove-Item "$($slack_cli_dir)\slack_cli.zip" } From da438b4904c81ae8fb6ecf96ccd2d89eab9110a6 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 16:02:15 -0800 Subject: [PATCH 19/22] fix: avoid hanging for unexpected command invocations --- scripts/install-windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 89825ac..fe7ca2d 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -184,7 +184,7 @@ function install_git { } else { try { - git | Out-Null + git --version | Out-Null Write-Host "Git is already installed. Nice!" } catch [System.Management.Automation.CommandNotFoundException] { @@ -244,7 +244,7 @@ function next_step_message { $confirmed_alias = check_slack_binary_exist $Alias $Version $false if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) { try { - $confirmed_alias | Out-Null + & $confirmed_alias --version | Out-Null Write-Host "`nYou're all set! Relaunch your terminal to ensure changes take effect." Write-Host " Then, authorize your CLI in your workspace with ``$confirmed_alias login``.`n" } From 0915651de2df0839edf0b83e283a1cb88c7456d7 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 16:11:51 -0800 Subject: [PATCH 20/22] temp: fingerprint in ci again let us hope for the best --- scripts/install-windows.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index fe7ca2d..99f591d 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -55,6 +55,8 @@ function check_slack_binary_exist() { delay 0.2 "Heads up! A binary called ``$SLACK_CLI_NAME`` was found!" delay 0.3 "Now checking if it's the same Slack CLI..." } + Write-Host "starting $SLACK_CLI_NAME _fingerprint" + & $SLACK_CLI_NAME _fingerprint $get_finger_print = (& $SLACK_CLI_NAME _fingerprint 2>&1 | Out-String).Trim() if ($get_finger_print -ne $FINGERPRINT) { $slack_cli_version = (& $SLACK_CLI_NAME --version 2>&1 | Out-String) From b7bc6952f56aaef08dc040c79ae54a963c99fa85 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 16:16:38 -0800 Subject: [PATCH 21/22] fix: skip conditional errors if the installation is failing --- scripts/install-windows.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 99f591d..19a2f1f 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -220,7 +220,7 @@ function terms_of_service { [string]$Alias ) $confirmed_alias = check_slack_binary_exist $Alias $Version $true - if (Get-Command $confirmed_alias) { + if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) { Write-Host "`nUse of the Slack CLI should comply with the Slack API Terms of Service:" Write-Host " https://slack.com/terms-of-service/api" } @@ -232,7 +232,7 @@ function feedback_message { [string]$Alias ) $confirmed_alias = check_slack_binary_exist $Alias $Version $false - if (Get-Command $confirmed_alias) { + if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) { Write-Host "`nWe would love to know how things are going. Really. All of it." Write-Host " Survey your development experience with ``$confirmed_alias feedback``" } From a06a02cb96b61dfef5f189e5e2b693ac65213501 Mon Sep 17 00:00:00 2001 From: Eden Zimbelman Date: Tue, 16 Dec 2025 16:26:55 -0800 Subject: [PATCH 22/22] revert: undo attempts at testing windows installation in ci for now --- .github/workflows/tests.yml | 29 ----------------------------- scripts/install-windows.ps1 | 29 ++++++++--------------------- 2 files changed, 8 insertions(+), 50 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a8499f1..c2c3360 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -42,35 +42,6 @@ jobs: files: ./coverage.out fail_ci_if_error: false - install: - name: Install - strategy: - matrix: - include: - - os: ubuntu-latest - - os: windows-latest - runs-on: ${{ matrix.os }} - permissions: - contents: read - steps: - - name: Checkout the latest changes - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - - name: Attempt the installation (Unix) - if: runner.os == 'Linux' - shell: bash - run: | - set -euo pipefail - ./scripts/install.sh - - name: Attempt the installation (Windows) - if: runner.os == 'Windows' - shell: pwsh - run: | - & ./scripts/install-windows.ps1 - - name: Confirm the version exists - run: slack --version - # Monitor code coverage and TODO/FIXME-type comments health-score: name: Health Score diff --git a/scripts/install-windows.ps1 b/scripts/install-windows.ps1 index 19a2f1f..dbd7dc2 100644 --- a/scripts/install-windows.ps1 +++ b/scripts/install-windows.ps1 @@ -55,11 +55,9 @@ function check_slack_binary_exist() { delay 0.2 "Heads up! A binary called ``$SLACK_CLI_NAME`` was found!" delay 0.3 "Now checking if it's the same Slack CLI..." } - Write-Host "starting $SLACK_CLI_NAME _fingerprint" - & $SLACK_CLI_NAME _fingerprint - $get_finger_print = (& $SLACK_CLI_NAME _fingerprint 2>&1 | Out-String).Trim() + & $SLACK_CLI_NAME _fingerprint | Tee-Object -Variable get_finger_print | Out-Null if ($get_finger_print -ne $FINGERPRINT) { - $slack_cli_version = (& $SLACK_CLI_NAME --version 2>&1 | Out-String) + & $SLACK_CLI_NAME --version | Tee-Object -Variable slack_cli_version | Out-Null if (!($slack_cli_version -contains "Using ${SLACK_CLI_NAME}.exe v")) { Write-Host "Error: Your existing ``$SLACK_CLI_NAME`` command is different from this Slack CLI!" Write-Host "Halting the install to avoid accidentally overwriting it." @@ -162,17 +160,9 @@ function install_slack_cli { $Path = [System.Environment]::GetEnvironmentVariable('Path', $User) if (!(";${Path};".ToLower() -like "*;${slack_cli_bin_dir};*".ToLower())) { Write-Host "Adding ``$confirmed_alias.exe`` to your Path environment variable" - if ([Environment]::UserInteractive) { - try { - [System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User) - } - catch { - # Silently continue if SetEnvironmentVariable fails - } - } + [System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User) $Env:Path = $Env:Path.TrimEnd(';') + ";$slack_cli_bin_dir" } - Remove-Item "$($slack_cli_dir)\slack_cli.zip" } @@ -186,7 +176,7 @@ function install_git { } else { try { - git --version | Out-Null + git | Out-Null Write-Host "Git is already installed. Nice!" } catch [System.Management.Automation.CommandNotFoundException] { @@ -219,8 +209,8 @@ function terms_of_service { [Parameter(HelpMessage = "Alias of Slack CLI")] [string]$Alias ) - $confirmed_alias = check_slack_binary_exist $Alias $Version $true - if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) { + $confirmed_alias = check_slack_binary_exist $Alias $Version $false + if (Get-Command $confirmed_alias) { Write-Host "`nUse of the Slack CLI should comply with the Slack API Terms of Service:" Write-Host " https://slack.com/terms-of-service/api" } @@ -232,7 +222,7 @@ function feedback_message { [string]$Alias ) $confirmed_alias = check_slack_binary_exist $Alias $Version $false - if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) { + if (Get-Command $confirmed_alias) { Write-Host "`nWe would love to know how things are going. Really. All of it." Write-Host " Survey your development experience with ``$confirmed_alias feedback``" } @@ -246,7 +236,7 @@ function next_step_message { $confirmed_alias = check_slack_binary_exist $Alias $Version $false if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) { try { - & $confirmed_alias --version | Out-Null + $confirmed_alias | Out-Null Write-Host "`nYou're all set! Relaunch your terminal to ensure changes take effect." Write-Host " Then, authorize your CLI in your workspace with ``$confirmed_alias login``.`n" } @@ -261,9 +251,6 @@ function next_step_message { trap { Write-Host "`nWe would love to know how things are going. Really. All of it." Write-Host "Submit installation issues: https://github.com/slackapi/slack-cli/issues" - - - $_ | Format-List * | Out-String | Write-Host exit 1 }