Closed devoncarew closed 9 years ago
This package might simplify things: https://www.npmjs.com/package/which.
This is what the package originally did. There was a problem with it at the time, which is why I switched to an explicit directory setting, but I'm not sure what the problem was now. I think it had something to do with locating SDK-related files.
Let me look through the git logs and see what the issue was and if it's still a problem.
Looks like I wasn't able to determine symlinkyness in order to find the SDK in the old code.
I don't think it's impossible, I just didn't care that much at the time, I think.
which is why I switched to an explicit directory setting
I think an explicit setting is a great idea - it lets the user override or correct an auto-discovered SDK. Auto-discovery will help smooth over the initial setup / getting started process.
This would really rock. It was a challenge for me to set up in IntelliJ, Atom and Sublime as I was not sure what path was expected for the 'sdk' and in all cases the error messages weren't very helpful. Auto-discovery could avoid unnecessary frustration.
FWIW the sublime plugin continues to ask the user for an explicit SDK directory. auto-discovery was challenging. If you come up with a good auto-discovery scheme, we'd like to use it in the Sublime plugin, too.
This would be nice to have. Many people installing
dart-tools
will already have an SDK installed. It'll mean they have one fewer setup steps to do dart development.Here's a technique I've used for other tooling. locating the VM:
/bin/bash -l -c "which dart"
. You want to run it in bash since exec runs in csh (I think?), but most people have their env vars set up in bashwhich dart
where dart.exe
(and possibly fall back to parsing the PATH var)Once you have the vm, you want to find the sdk. Tools like brew install the vm in a symlinked dir, so you want to resolve the vm if it's a symlink, and then go up one dir.
@radicaled @lukechurch