-
Notifications
You must be signed in to change notification settings - Fork 436
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
Search asdf directories for scarb executable #3665
Search asdf directories for scarb executable #3665
Conversation
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.
Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @spapinistarkware and @szymmis)
vscode-cairo/src/extension.ts
line 111 at r1 (raw file):
if (os.platform() === "win32") return undefined; const asdfDataDir = process.env.ASDF_DATA_DIR ?? `${process.env.HOME}/.asdf`;
- I think I'd bail out (return undefined from this function) if HOME is empty
Suggestion:
path.join(process.env.HOME, ".asdf")
vscode-cairo/src/extension.ts
line 117 at r1 (raw file):
.access(scarbExecutablePath, fs.constants.X_OK) .then(() => scarbExecutablePath) .catch(() => undefined);
Nit
Suggestion:
try {
return await fs.promises.access(scarbExecutablePath, fs.constants.X_OK);
} catch _e {
return undefined;
}
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @spapinistarkware)
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @szymmis)
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.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @szymmis)
Sometimes due to specific setup (like having custom ASDF_DATA_DIR variable) asdf scarb shim might not available through PATH variable. To solve this problem we can look for the executable in asdf directories as a fallback. Concept based on what intellij does when looking for java.
Worth noting that asdf is not supported on Windows machines outside WSL so when win32 platform is detected we just return undefined.
This change is