Skip to content

Commit a06a02c

Browse files
committed
revert: undo attempts at testing windows installation in ci for now
1 parent b7bc695 commit a06a02c

File tree

2 files changed

+8
-50
lines changed

2 files changed

+8
-50
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,6 @@ jobs:
4242
files: ./coverage.out
4343
fail_ci_if_error: false
4444

45-
install:
46-
name: Install
47-
strategy:
48-
matrix:
49-
include:
50-
- os: ubuntu-latest
51-
- os: windows-latest
52-
runs-on: ${{ matrix.os }}
53-
permissions:
54-
contents: read
55-
steps:
56-
- name: Checkout the latest changes
57-
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
58-
with:
59-
persist-credentials: false
60-
- name: Attempt the installation (Unix)
61-
if: runner.os == 'Linux'
62-
shell: bash
63-
run: |
64-
set -euo pipefail
65-
./scripts/install.sh
66-
- name: Attempt the installation (Windows)
67-
if: runner.os == 'Windows'
68-
shell: pwsh
69-
run: |
70-
& ./scripts/install-windows.ps1
71-
- name: Confirm the version exists
72-
run: slack --version
73-
7445
# Monitor code coverage and TODO/FIXME-type comments
7546
health-score:
7647
name: Health Score

scripts/install-windows.ps1

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,9 @@ function check_slack_binary_exist() {
5555
delay 0.2 "Heads up! A binary called ``$SLACK_CLI_NAME`` was found!"
5656
delay 0.3 "Now checking if it's the same Slack CLI..."
5757
}
58-
Write-Host "starting $SLACK_CLI_NAME _fingerprint"
59-
& $SLACK_CLI_NAME _fingerprint
60-
$get_finger_print = (& $SLACK_CLI_NAME _fingerprint 2>&1 | Out-String).Trim()
58+
& $SLACK_CLI_NAME _fingerprint | Tee-Object -Variable get_finger_print | Out-Null
6159
if ($get_finger_print -ne $FINGERPRINT) {
62-
$slack_cli_version = (& $SLACK_CLI_NAME --version 2>&1 | Out-String)
60+
& $SLACK_CLI_NAME --version | Tee-Object -Variable slack_cli_version | Out-Null
6361
if (!($slack_cli_version -contains "Using ${SLACK_CLI_NAME}.exe v")) {
6462
Write-Host "Error: Your existing ``$SLACK_CLI_NAME`` command is different from this Slack CLI!"
6563
Write-Host "Halting the install to avoid accidentally overwriting it."
@@ -162,17 +160,9 @@ function install_slack_cli {
162160
$Path = [System.Environment]::GetEnvironmentVariable('Path', $User)
163161
if (!(";${Path};".ToLower() -like "*;${slack_cli_bin_dir};*".ToLower())) {
164162
Write-Host "Adding ``$confirmed_alias.exe`` to your Path environment variable"
165-
if ([Environment]::UserInteractive) {
166-
try {
167-
[System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User)
168-
}
169-
catch {
170-
# Silently continue if SetEnvironmentVariable fails
171-
}
172-
}
163+
[System.Environment]::SetEnvironmentVariable('Path', $Path.TrimEnd(';') + ";${slack_cli_bin_dir}", $User)
173164
$Env:Path = $Env:Path.TrimEnd(';') + ";$slack_cli_bin_dir"
174165
}
175-
176166
Remove-Item "$($slack_cli_dir)\slack_cli.zip"
177167
}
178168

@@ -186,7 +176,7 @@ function install_git {
186176
}
187177
else {
188178
try {
189-
git --version | Out-Null
179+
git | Out-Null
190180
Write-Host "Git is already installed. Nice!"
191181
}
192182
catch [System.Management.Automation.CommandNotFoundException] {
@@ -219,8 +209,8 @@ function terms_of_service {
219209
[Parameter(HelpMessage = "Alias of Slack CLI")]
220210
[string]$Alias
221211
)
222-
$confirmed_alias = check_slack_binary_exist $Alias $Version $true
223-
if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) {
212+
$confirmed_alias = check_slack_binary_exist $Alias $Version $false
213+
if (Get-Command $confirmed_alias) {
224214
Write-Host "`nUse of the Slack CLI should comply with the Slack API Terms of Service:"
225215
Write-Host " https://slack.com/terms-of-service/api"
226216
}
@@ -232,7 +222,7 @@ function feedback_message {
232222
[string]$Alias
233223
)
234224
$confirmed_alias = check_slack_binary_exist $Alias $Version $false
235-
if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) {
225+
if (Get-Command $confirmed_alias) {
236226
Write-Host "`nWe would love to know how things are going. Really. All of it."
237227
Write-Host " Survey your development experience with ``$confirmed_alias feedback``"
238228
}
@@ -246,7 +236,7 @@ function next_step_message {
246236
$confirmed_alias = check_slack_binary_exist $Alias $Version $false
247237
if (Get-Command $confirmed_alias -ErrorAction SilentlyContinue) {
248238
try {
249-
& $confirmed_alias --version | Out-Null
239+
$confirmed_alias | Out-Null
250240
Write-Host "`nYou're all set! Relaunch your terminal to ensure changes take effect."
251241
Write-Host " Then, authorize your CLI in your workspace with ``$confirmed_alias login``.`n"
252242
}
@@ -261,9 +251,6 @@ function next_step_message {
261251
trap {
262252
Write-Host "`nWe would love to know how things are going. Really. All of it."
263253
Write-Host "Submit installation issues: https://github.com/slackapi/slack-cli/issues"
264-
265-
266-
$_ | Format-List * | Out-String | Write-Host
267254
exit 1
268255
}
269256

0 commit comments

Comments
 (0)