-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
fix init project exception on windows #17
Conversation
First of all: thanks! Could you change it so as to first test if |
ok, I change the code to use dynamic var bind. |
clj/src/cljd/build.clj
Outdated
config (if (.exists f) | ||
(with-open [rdr (-> f io/reader java.io.PushbackReader.)] | ||
(edn/read rdr)) | ||
{})] | ||
(binding [*ansi* (and (System/console) (get (System/getenv) "TERM")) | ||
*dart* (if is-windows? "dart.bat" *dart*) |
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.
Note: I installed Dart using the official instructions on https://dart.dev/get-dart, and instead of "dart.bat" I have "dart.exe"
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.
The separately installed dart sdk does contain an entry for dart.exe, but the dart sdk provided by flutter executes the FLUTTER_PATH\bin\cache\dart-sdk\bin\dart.exe program through the dart.bat script.
In the command line, the dart command always works, but in the code, I need to delete the wrong dart binary under flutter/bin and add the dart sdk to the PATH before I can use dart.exe to find dart, which Not user friendly either.
Maybe look in the code for dart.exe (from Dart users) and dart.bat (from Flutter users) and find one of them.
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.
I would expect cljd to work without flutter installed? I don't have flutter, hence I don't have dart.bat, only dart.exe...
On Windows, the default environment variable is Path instead of PATH, so the execute function has a null pointer problem here.
In addition, the bin directory in the sdk distributed by flutter contains two programs, dart and dart.bat, in which the execute function will incorrectly find dart (not a valid Win32 program under Windows).