Hi there! Love what you're doing with chuck; I just ran into a small paper cut that I wanted to flag.
Summary
When a .ck file starts with a #! shebang line, chuck throws a syntax error instead of ignoring it. This makes it impossible to use .ck files as directly executable scripts on Unix.
Environment
- chuck version: 1.5.5.8-dev (chai)
- Platform: Linux x86_64
Steps to reproduce
- Create a file
hello.ck:
#!/usr/local/bin/chuck
<<<"Hello World!">>>;
- Run it:
- Result:
hello.ck:1:1: syntax error
[1] #!/usr/local/bin/chuck
^
Expected behavior
chuck should ignore a #! line at the start of a file, so that .ck scripts can be made executable:
chmod +x hello.ck
./hello.ck
This is standard practice for interpreted languages. Node.js, for example, also uses // for comments and not #, but still skips a leading #! line.
Since #! is already a syntax error in chuck, ignoring it on the first line is a safe, non-breaking change that has no effect on existing valid .ck files.
Hi there! Love what you're doing with chuck; I just ran into a small paper cut that I wanted to flag.
Summary
When a
.ckfile starts with a#!shebang line, chuck throws a syntax error instead of ignoring it. This makes it impossible to use.ckfiles as directly executable scripts on Unix.Environment
Steps to reproduce
hello.ck:Expected behavior
chuck should ignore a
#!line at the start of a file, so that.ckscripts can be made executable:This is standard practice for interpreted languages. Node.js, for example, also uses
//for comments and not#, but still skips a leading#!line.Since
#!is already a syntax error in chuck, ignoring it on the first line is a safe, non-breaking change that has no effect on existing valid.ckfiles.