Repository navigation
feat(cli-docs): Serve /install.ps1/<handoff code> with SENTRY_HANDOFF set - #2429
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
… set Windows gets the same one-liner as bash: irm https://cli.sentry.dev/install.ps1/<code> | iex The handoff function now serves both install scripts. Because iex runs in the caller's session, the PowerShell variant clears SENTRY_HANDOFF in a finally block once the install ends. Co-Authored-By: Evan Purkhiser <1421724+evanpurkhiser@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #2354, which added this only for bash. Windows now gets the same one-liner:
irm https://cli.sentry.dev/install.ps1/sntryh_… | iex.One Edge Function now serves both scripts. The route
^/(install|install\.ps1)/(<code>)$rewrites to/install-handoff?script=$1&code=$2. The handler returns 404 for any other script name, and it still accepts only codes that matchHANDOFF_CODE.install.ps1already passesSENTRY_HANDOFFtosentry cli setup, so the script itself doesn't change.PowerShell differs from bash in one way.
curl | bashruns in a child process, so theexportgoes away when the install ends.iexruns in the caller's session, so$env:SENTRY_HANDOFFwould stay set afterwards. To prevent that, the PowerShell response sets the variable, wraps the script intry { … } finally { Remove-Item Env:SENTRY_HANDOFF }, and so clears it even when the install throws. Wrapping is safe becauseinstall.ps1has noparam,using, or#Requiresstatement that must come first. Plain/installand/install.ps1don't change.Open questions
/install.ps1/<code>the URL that Sentry's setup page should show? It mirrors/install/<code>, and feat(cli-docs): Serve /install/<handoff code> with SENTRY_HANDOFF set #2354 suggested it./install/<code>.ps1would also work.via @evanpurkhiser.
--
View Session [Sentry]