-
Notifications
You must be signed in to change notification settings - Fork 24
feat: output a link to the issue tracker if installation scripts fail #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7c42bef
feat: output the issue tracker if installation scripts fail
zimeg cbeed29
feat: match the issue tracker outputs on windows
zimeg 7d01f28
feat: include the windows development installer script too
zimeg 128d01b
style: match outputs to submit installation issues
zimeg 53af12a
chore: merge w main
zimeg 0d1f812
fix: catch erroring stacktraces when the version does not exist
zimeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -70,7 +70,7 @@ function check_slack_binary_exist() { | |
|
|
||
| Write-Host "`nTry using an alias when installing to avoid name conflicts:" | ||
| Write-Host "`nirm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 -Alias your-preferred-alias | iex" | ||
| Exit; | ||
| throw | ||
| } | ||
| } | ||
| $message = "It is the same Slack CLI! Upgrading to the latest version..." | ||
|
|
@@ -116,7 +116,8 @@ function install_slack_cli { | |
| } | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot find latest Slack CLI release version" | ||
| Write-Error "Installer cannot find latest Slack CLI release version" | ||
| throw | ||
| } | ||
|
|
||
| $slack_cli_dir = "${Home}\AppData\Local\slack-cli" | ||
|
|
@@ -133,14 +134,16 @@ function install_slack_cli { | |
| $slack_cli_dir = $alternative_slack_cli_dir | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot create folder in $($alternative_slack_cli_dir). `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| Write-Error "Installer cannot create folder in $($alternative_slack_cli_dir). `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| throw | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot create folder for Slack CLI, `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| Write-Error "Installer cannot create folder for Slack CLI, `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| throw | ||
| } | ||
|
|
||
| if ($Version -eq "dev") { | ||
|
|
@@ -153,7 +156,8 @@ function install_slack_cli { | |
| Invoke-WebRequest -Uri "https://downloads.slack-edge.com/slack-cli/slack_cli_$($SLACK_CLI_VERSION)_windows_64-bit.zip" -OutFile "$($slack_cli_dir)\slack_cli.zip" | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot download Slack CLI" | ||
| Write-Error "Installer cannot download Slack CLI" | ||
| throw | ||
| } | ||
|
|
||
| $slack_cli_bin_dir = "$($slack_cli_dir)\bin" | ||
|
|
@@ -243,7 +247,8 @@ function install_deno { | |
| Write-Host "Comparing the currently installed Deno version... Found: v$deno_version_local" | ||
| } | ||
| else { | ||
| throw "Deno is not installed! Please install Deno to at least v$MIN_DENO_VERSION and try again." | ||
| Write-Error "Deno is not installed! Please install Deno to at least v$MIN_DENO_VERSION and try again." | ||
| throw | ||
| } | ||
|
|
||
| if ($deno_version_latest -eq "v$deno_version_local") { | ||
|
|
@@ -262,7 +267,8 @@ function install_deno { | |
| Write-Host "Nice! Your Deno version has been updated and is ready!" | ||
| } | ||
| catch { | ||
| throw "`nDeno is not installed, please install deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| Write-Error "Deno is not installed, please install deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| throw | ||
| } | ||
| } | ||
| else { | ||
|
|
@@ -280,7 +286,8 @@ function install_deno { | |
| Write-Host "Your Deno version is compatible with the Slack CLI!" | ||
| } | ||
| catch { | ||
| throw "`nDeno is not installed, please install Deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| Write-Error "Deno is not installed, please install Deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| throw | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -339,11 +346,19 @@ function next_step_message { | |
| Write-Host " Then, authorize your CLI in your workspace with ``$confirmed_alias login``.`n" | ||
| } | ||
| catch { | ||
| throw "`nSlack CLI is not installed.`nPlease reach out to [email protected] to share the issues you are facing.`nMeanwhile you can try the manual installation: https://tools.slack.dev/slack-cli.`n" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💌 We now have an issue tracker to direct the most kind folks to! |
||
| Write-Error "Slack CLI was not installed." | ||
| Write-Host "`nFind help troubleshooting: https://tools.slack.dev/slack-cli" | ||
| throw | ||
| } | ||
| } | ||
| } | ||
|
|
||
| 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" | ||
| exit 1 | ||
| } | ||
|
|
||
| install_slack_cli $Alias $Version | ||
| install_deno $SkipDeno | ||
| Write-Host "`nAdding developer tooling for an enhanced experience..." | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,7 +67,7 @@ function check_slack_binary_exist() { | |
|
|
||
| Write-Host "`nTry using an alias when installing to avoid name conflicts:" | ||
| Write-Host "`nirm https://downloads.slack-edge.com/slack-cli/install-windows.ps1 -Alias your-preferred-alias | iex" | ||
| Exit; | ||
| throw | ||
| } | ||
| } | ||
| $message = "It is the same Slack CLI! Upgrading to the latest version..." | ||
|
|
@@ -113,7 +113,8 @@ function install_slack_cli { | |
| } | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot find latest Slack CLI release version" | ||
| Write-Error "Installer cannot find latest Slack CLI release version" | ||
| throw | ||
| } | ||
|
|
||
| $slack_cli_dir = "${Home}\AppData\Local\slack-cli" | ||
|
|
@@ -131,20 +132,23 @@ function install_slack_cli { | |
| $slack_cli_dir = $alternative_slack_cli_dir | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot create folder in $($alternative_slack_cli_dir). `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| Write-Error "Installer cannot create folder in $($alternative_slack_cli_dir). `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| throw | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot create folder for Slack CLI, `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| Write-Error "Installer cannot create folder for Slack CLI, `nPlease manually create $($slack_cli_dir) folder and re-run the installation script" | ||
| throw | ||
| } | ||
| try { | ||
| Invoke-WebRequest -Uri "https://downloads.slack-edge.com/slack-cli/slack_cli_$($SLACK_CLI_VERSION)_windows_64-bit.zip" -OutFile "$($slack_cli_dir)\slack_cli.zip" | ||
| } | ||
| catch { | ||
| throw "`nInstaller cannot download Slack CLI" | ||
| Write-Error "Installer cannot download Slack CLI" | ||
| throw | ||
| } | ||
|
|
||
| $slack_cli_bin_dir = "$($slack_cli_dir)\bin" | ||
|
|
@@ -234,7 +238,8 @@ function install_deno { | |
| Write-Host "Comparing the currently installed Deno version... Found: v$deno_version_local" | ||
| } | ||
| else { | ||
| throw "Deno is not installed! Please install Deno to at least v$MIN_DENO_VERSION and try again." | ||
| Write-Error "Deno is not installed! Please install Deno to at least v$MIN_DENO_VERSION and try again." | ||
| throw | ||
| } | ||
|
|
||
| if ($deno_version_latest -eq "v$deno_version_local") { | ||
|
|
@@ -253,7 +258,8 @@ function install_deno { | |
| Write-Host "Nice! Your Deno version has been updated and is ready!" | ||
| } | ||
| catch { | ||
| throw "`nDeno is not installed, please install deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| Write-Error "Deno is not installed, please install deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| throw | ||
| } | ||
| } | ||
| else { | ||
|
|
@@ -271,7 +277,8 @@ function install_deno { | |
| Write-Host "Your Deno version is compatible with the Slack CLI!" | ||
| } | ||
| catch { | ||
| throw "`nDeno is not installed, please install Deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| Write-Error "Deno is not installed, please install Deno manually to at least $MIN_DENO_VERSION and re-run this script." | ||
| throw | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -330,11 +337,19 @@ function next_step_message { | |
| Write-Host " Then, authorize your CLI in your workspace with ``$confirmed_alias login``.`n" | ||
| } | ||
| catch { | ||
| throw "`nSlack CLI is not installed.`nPlease reach out to [email protected] to share the issues you are facing.`nMeanwhile you can try the manual installation: https://tools.slack.dev/slack-cli`n" | ||
| Write-Error "Slack CLI was not installed." | ||
| Write-Host "`nFind help troubleshooting: https://tools.slack.dev/slack-cli" | ||
| throw | ||
| } | ||
| } | ||
| } | ||
|
|
||
| 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" | ||
| exit 1 | ||
| } | ||
|
|
||
| install_slack_cli $Alias $Version | ||
| install_deno $SkipDeno | ||
| Write-Host "`nAdding developer tooling for an enhanced experience..." | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 The
exitcommand is replaced with areturnto avoid ending the script altogether for later logic.