Skip to content

Commit c21a654

Browse files
committed
chore: finalize changes
1 parent c12e2a3 commit c21a654

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

scripts/install-windows-dev.ps1

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@ function check_slack_binary_exist() {
5858
delay 0.2 "Heads up! A binary called ``$SLACK_CLI_NAME`` was found!"
5959
delay 0.3 "Now checking if it's the same Slack CLI..."
6060
}
61+
& $SLACK_CLI_NAME _fingerprint | Tee-Object -Variable get_finger_print | Out-Null
62+
if ($get_finger_print -ne $FINGERPRINT) {
63+
& $SLACK_CLI_NAME --version | Tee-Object -Variable slack_cli_version | Out-Null
64+
if (!($slack_cli_version -contains "Using ${SLACK_CLI_NAME}.exe v")) {
65+
Write-Host "Error: Your existing ``$SLACK_CLI_NAME`` command is different from this Slack CLI!"
66+
Write-Host "Halting the install to avoid accidentally overwriting it."
67+
68+
Write-Host "`nTry using an alias when installing to avoid name conflicts:"
69+
Write-Host "`nirm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 -Alias your-preferred-alias | iex"
70+
throw
71+
}
72+
}
73+
$message = "It is the same Slack CLI! Upgrading to the latest version..."
6174
if ($Version) {
6275
$SLACK_CLI_VERSION = $Version
6376
$message = "It is the same Slack CLI! Switching over to v$Version..."
@@ -206,10 +219,10 @@ function terms_of_service {
206219
[string]$Alias
207220
)
208221
$confirmed_alias = check_slack_binary_exist $Alias $Version $false
209-
# if (Get-Command $confirmed_alias) {
210-
Write-Host "`nUse of the Slack CLI should comply with the Slack API Terms of Service:"
211-
Write-Host " https://slack.com/terms-of-service/api"
212-
# }
222+
if (Get-Command $confirmed_alias) {
223+
Write-Host "`nUse of the Slack CLI should comply with the Slack API Terms of Service:"
224+
Write-Host " https://slack.com/terms-of-service/api"
225+
}
213226
}
214227

215228
function feedback_message {
@@ -247,13 +260,13 @@ function next_step_message {
247260
trap {
248261
Write-Host "`nWe would love to know how things are going. Really. All of it."
249262
Write-Host "Submit installation issues: https://github.com/slackapi/slack-cli/issues"
250-
exit 7
263+
exit 1
251264
}
252265

253266
install_slack_cli $Alias $Version
254267
Write-Host "`nAdding developer tooling for an enhanced experience..."
255268
install_git $SkipGit
256269
Write-Host "Sweet! You're all set to start developing!"
257270
terms_of_service $Alias
258-
# feedback_message $Alias
259-
# next_step_message $Alias
271+
feedback_message $Alias
272+
next_step_message $Alias

scripts/install-windows.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ function install_git {
176176
}
177177
else {
178178
try {
179-
git | Out-Null
179+
Get-Command git -ErrorAction Stop | Out-Null
180180
Write-Host "Git is already installed. Nice!"
181181
}
182182
catch [System.Management.Automation.CommandNotFoundException] {

0 commit comments

Comments
 (0)