Skip to content

Commit

Permalink
Chruby test suite looks for ruby binary in multiple locations
Browse files Browse the repository at this point in the history
Support both /opt/rubies and ~/.rubies for installation paths, checking
both the `engine-version` and `version` formats.
  • Loading branch information
adam12 committed Nov 28, 2024
1 parent 3b5a9ff commit 757c124
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion vscode/src/test/suite/ruby/chruby.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ function createRubySymlinks(destination: string) {
destination,
);
} else {
fs.symlinkSync(`/opt/rubies/${RUBY_VERSION}/bin/ruby`, destination);
const possibleLocations = [
`${os.homedir()}/.rubies/${RUBY_VERSION}/bin/ruby`,
`${os.homedir()}/.rubies/ruby-${RUBY_VERSION}/bin/ruby`,
`/opt/rubies/${RUBY_VERSION}/bin/ruby`,
`/opt/rubies/ruby-${RUBY_VERSION}/bin/ruby`

Check failure on line 36 in vscode/src/test/suite/ruby/chruby.test.ts

View workflow job for this annotation

GitHub Actions / lint_node

Insert `,`
];

for (const location of possibleLocations) {
if (fs.existsSync(location)) {
fs.symlinkSync(location, destination);
break;
}
}
}
}

Expand Down

0 comments on commit 757c124

Please sign in to comment.