Nuru icon indicating copy to clipboard operation
Nuru copied to clipboard

Add support for shebang in nuru

Open gekkowrld opened this issue 1 year ago • 0 comments

Describe the feature

shebang is a unix feature that is most of the scripting languages:

https://en.wikipedia.org//wiki/Shebang_(Unix)

Use Case

It will be nice to just execute the scripts without explicitly invoking the nuru interpreter every time.

Proposed Solution

Look at the first line and ignore if it starts with '#!' specifically, look at how it works as explained in the question on StackOverflow about shebang and its implementation in the linux kernel.

If the 'shebang' appears on any other line, then throw an error.

Other Information

No response

Acknowledgements

  • [ ] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

Version used

v0.5.1 (commit id f0fe30958893e)

Environment details (OS name and version, etc.)

Linux 6.9.3-hardened1-1-hardened go version go1.22.3 linux/amd64

gekkowrld avatar Jun 02 '24 11:06 gekkowrld