rune
rune copied to clipboard
error: Expected expression but got a shebang
Hello friends,
If I'm reading this right, shebang parsing (and ignoring) was implemented in #353 (requested in #270); however, I am unable to use shebang lines in my scripts in version git-496577c9 (just cloned and built on nightly-x86_64-unknown-linux-gnu and nightly-x86_64-unknown-illumos).
Steps to replicate:
- clone repo
cargo install --path crates/rune-cli(installing via crates.io produces brokenrune?)- create
hello_world.rnwith the following contents:
#!/usr/bin/env -S rune run
println!("Hellorld");
chmod +x hello_world.rn./hello_world.rn:
error: Expected expression but got a shebang
┌─ ./hello_world.rn:1:1
│
1 │ #!/usr/bin/env -S rune run
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^ Expected expression but got a shebang
Error: Failed to build rune sources (see diagnostics for details)
Expected output (from rune run hello_world.rn with shebang removed):
Hellorld
I haven't seen anything about this in the documentation, but it appears that shebangs are intended to work. Have I missed something? Am I not building it correctly to enable this feature? Is this related to the nightly toolchain?
Please let me know if anything is missing from this issue, I'll do my best to provide more information as required.