Skip to content

Please support scripts with a shebang (#!/usr/bin/env -S dotnet fsi) #22

@nodakai

Description

@nodakai
$ cat /tmp/a.fsx
#!/usr/bin/env -S dotnet fsi

printfn "Hello, world!"

$ /tmp/a.fsx
Hello, world!

$ dotnet fspack /tmp/a.fsx --aot -f net9.0 -o /tmp
Restore complete (0.4s)
  tmpAzo4rS.tmp failed with 1 error(s) (0.6s)
    /tmp/tmprRExlQ.tmp.fs(2,1): error FS0000: #! may only appear as the first line at the start of a file.

Build failed with 1 error(s) in 1.2s

$ cat /tmp/tmprRExlQ.tmp.fs
module A
#!/usr/bin/env -S dotnet fsi

printfn "Hello, world!"

I think you can ignore the first line if it starts with a shebang #!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions