Skip to content

Commit 85b2b75

Browse files
committed
fix: skip interactive additions to the path from claude suggestion
1 parent 7fc1800 commit 85b2b75

File tree

2 files changed

+12
-16
lines changed

2 files changed

+12
-16
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ jobs:
6262
shell: bash
6363
run: |
6464
set -euo pipefail
65-
bash ./scripts/install.sh
65+
./scripts/install.sh
6666
- name: Attempt the installation (Windows)
6767
if: runner.os == 'Windows'
6868
shell: pwsh
6969
run: |
70-
pwsh -NoProfile -NonInteractive -File ./scripts/install-windows.ps1
70+
& ./scripts/install-windows.ps1
71+
- name: Confirm the version exists
72+
run: slack --version
7173

7274
# Monitor code coverage and TODO/FIXME-type comments
7375
health-score:

scripts/install-windows.ps1

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,9 @@ function check_slack_binary_exist() {
4646
)
4747
$FINGERPRINT = "d41d8cd98f00b204e9800998ecf8427e"
4848
$SLACK_CLI_NAME = "slack"
49-
Write-Host "xd1: $alias"
50-
Write-Host "xd2: $Alias"
5149
if ($alias) {
5250
$SLACK_CLI_NAME = $alias
5351
}
54-
Write-Host "xd3: $SLACK_CLI_NAME"
55-
# & $SLACK_CLI_NAME _fingerprint
5652
if (Get-Command $SLACK_CLI_NAME -ErrorAction SilentlyContinue) {
5753
if ($Diagnostics) {
5854
delay 0.3 "Checking if ``$SLACK_CLI_NAME`` already exists on this system..."
@@ -164,19 +160,17 @@ function install_slack_cli {
164160
$Path = [System.Environment]::GetEnvironmentVariable('Path', $User)
165161
if (!(";${Path};".ToLower() -like "*;${slack_cli_bin_dir};*".ToLower())) {
166162
Write-Host "Adding ``$confirmed_alias.exe`` to your Path environment variable"
167-
[System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User)
163+
if ([Environment]::UserInteractive) {
164+
try {
165+
[System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User)
166+
}
167+
catch {
168+
# Silently continue if SetEnvironmentVariable fails
169+
}
170+
}
168171
$Env:Path = $Env:Path.TrimEnd(';') + ";$slack_cli_bin_dir"
169172
}
170173

171-
$old = $ErrorActionPreference
172-
$ErrorActionPreference = 'Continue'
173-
try {
174-
$fp = (& $confirmed_alias _fingerprint 2>&1 | Out-String).Trim()
175-
Write-Host "nooo $fp"
176-
} finally {
177-
$ErrorActionPreference = $old
178-
}
179-
180174
Remove-Item "$($slack_cli_dir)\slack_cli.zip"
181175
}
182176

0 commit comments

Comments
 (0)