Skip to content
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

Use separator for activation script result #2552

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

vinistock
Copy link
Member

Motivation

Closes #2370

Some users seem to have issues with their shells printing extra output when being invoked by NodeJS. This leads to an invalid JSON being returned by the activation script, which we fail to parse.

I believe we can make the activation more robust if we just print the activated JSON between two separators so that we can automatically ignore any extra output.

Implementation

I noticed that, with the exception of chruby, all activation scripts are almost identical. So I extract a good part of the logic to the parent class, so that we can more easily share with all manager integrations.

Then I started printing the environment between two separators and we look for those before parsing the result.

Automated Tests

Had to updated the stubs on all tests to match the new behaviour.

Manual Tests

Since version manager integrations are always critical, I would like to make a preview release to verify if everything is fixed and works as expected after this PR is approved, but before shipping.

@vinistock vinistock added bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes labels Sep 13, 2024
@vinistock vinistock self-assigned this Sep 13, 2024
@vinistock vinistock requested a review from a team as a code owner September 13, 2024 19:49
@vinistock vinistock requested review from andyw8 and st0012 September 13, 2024 19:49
@vinistock vinistock force-pushed the vs-unify-activation-script branch from 582ad40 to eadcfec Compare September 13, 2024 19:56
@vinistock vinistock merged commit f7b8fd1 into main Sep 18, 2024
34 checks passed
@vinistock vinistock deleted the vs-unify-activation-script branch September 18, 2024 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatic Ruby environment activation with none failed: Unexpected token 'y' "your 13107"... is not valid JSON
2 participants