@@ -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 " `n Try using an alias when installing to avoid name conflicts:"
69+ Write-Host " `n irm 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 " `n Use 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 " `n Use 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
215228function feedback_message {
@@ -247,13 +260,13 @@ function next_step_message {
247260trap {
248261 Write-Host " `n We 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
253266install_slack_cli $Alias $Version
254267Write-Host " `n Adding developer tooling for an enhanced experience..."
255268install_git $SkipGit
256269Write-Host " Sweet! You're all set to start developing!"
257270terms_of_service $Alias
258- # feedback_message $Alias
259- # next_step_message $Alias
271+ feedback_message $Alias
272+ next_step_message $Alias
0 commit comments