Closed joeyespo closed 7 years ago
Good case and good solution, I think.
I like it. What are common program names besides node
?
What are common program names besides node?
ruby
, python
(?, maybe something with 2
or 3
), php
, sh
, bash
… Any interpreted language, I guess :)
I just came across a file that uses
#!/usr/bin/env node
instead of a.js
extension. It threw me off for a second because GitHub still syntax highlighted it, but no Module Linker links showed up.I noticed the switch statement to detect the language. If there's no match, could
main()
also see if the first line begins with#!
, and if it does, check that for common program names?What are your thoughts of this approach?