Add doctor command to diagnose common problems and print information for further debug
See original GitHub issueHaving more than an instance of scala-cli on PATH creates problems with updates, since an old version might appear sooner on PATH and get executed instead of the newer version!
How should it work:
The user runs
scala-cli doctor
Then, if there are any duplicates on PATH it gets reported to the user!
One implementation strategy is
- first seeing if
type -ap scala-cli
shows duplicates; - then if so, we run
ls -l
on the result to make sure they are not all symlinks to the same location. - Then if they were not symlinks, we
cat
the contents of them to see if they run the same script. (this is tricky) - Now if they weren’t scripts executing the same thing, we produce a PATH duplicates error
Alternatively, this information can be provided by running the update, about, or version commands.
The team decided that the PATH duplicate part of issue #543 should be dealt with as an independent separate issue. It is also related to issue #670
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (15 by maintainers)
Top Results From Across the Web
Debugging - DynamoRIO
Use debug builds (pass "-debug" to drrun) with notifications turned on to diagnose errors. In general, it is much easier to debug with...
Read more >[Learning note] Troubleshooting and Debugging Techniques
Q: A very common method of debugging is to add print statements to our code that display information, such as contents of variables,...
Read more >21. Error Handling and Debugging - Practical mod_perl [Book]
Chapter 21. Error Handling and Debugging Every programmer needs to know how to debug his programs. It is an easy task with plain...
Read more >Java HotSpot VM Command-Line Options - Oracle Help Center
This appendix describes some command-line options that can be useful when diagnosing problems with the Java HotSpot VM.
Read more >Cisco IOS Debug Command Reference - Commands I through L
To troubleshoot HTTP authentication problems, use the debug ip http authentication command in privileged EXEC mode. To disable debugging output, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
re: coursier - i get your point. strategically, i think it should be delivered by coursier, though. if you’re going to pay the climbing-the-learning-curve price for only one tool (e.g. as a student in a class), installing coursier manually gets you more for your money. chris kipp asked me to open a coursier issue requesting that scala-cli move out from under “install --contrib” to just “install”. haven’t done it yet but i will.
re: doctor - that’s a great list of things to-do. speaking only for myself, that won’t fit into two hours. for some reason i didn’t see your post until today. however, i’d be happy to work on this well after the spree ends.
Let’s call it
doctor
, in imitation of Homebrew (and also Metals, according to @romanowski).