Skip to content

Commit

Permalink
Add support for ASDF_ENV environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
srcid committed Oct 8, 2024
1 parent 844c0c3 commit 0dd6719
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions vscode/src/ruby/asdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,18 @@ export class Asdf extends VersionManager {
const scriptName =
path.basename(vscode.env.shell) === "fish" ? "asdf.fish" : "asdf.sh";

if (process.env['ASDF_DIR']) {

Check failure on line 32 in vscode/src/ruby/asdf.ts

View workflow job for this annotation

GitHub Actions / lint_node

Replace `'ASDF_DIR'` with `"ASDF_DIR"`

Check failure on line 32 in vscode/src/ruby/asdf.ts

View workflow job for this annotation

GitHub Actions / lint_node

["ASDF_DIR"] is better written in dot notation
// Follow the ASDF_DIR if it was set up.
const possiblePath = vscode.Uri.joinPath(vscode.Uri.parse(process.env["ASDF_DIR"]), scriptName)

Check failure on line 34 in vscode/src/ruby/asdf.ts

View workflow job for this annotation

GitHub Actions / lint_node

Replace `vscode.Uri.parse(process.env["ASDF_DIR"]),·scriptName)` with `⏎········vscode.Uri.parse(process.env["ASDF_DIR"]),⏎········scriptName,`

Check failure on line 34 in vscode/src/ruby/asdf.ts

View workflow job for this annotation

GitHub Actions / lint_node

["ASDF_DIR"] is better written in dot notation

Check failure on line 35 in vscode/src/ruby/asdf.ts

View workflow job for this annotation

GitHub Actions / lint_node

Insert `);⏎`
try {
await vscode.workspace.fs.stat(possiblePath);
return possiblePath;
} catch (error: any) {
// Continue looking
}
}

Check failure on line 43 in vscode/src/ruby/asdf.ts

View workflow job for this annotation

GitHub Actions / lint_node

Delete `····`
// Possible ASDF installation paths as described in https://asdf-vm.com/guide/getting-started.html#_3-install-asdf.
// In order, the methods of installation are:
// 1. Git
Expand Down

0 comments on commit 0dd6719

Please sign in to comment.