Skip to content

Allow shebang usage without .nim extension #18720

@al6x

Description

@al6x

It's possible to make executable nim scripts with shebang and run it as ./hello.nim.

But it won't work if the file renamed into ./hello without the extension. If you run nim r hello the Nim compiler appends the .nim extension and tries to execute it as nim r hello.nim and fails because there's no such file.

Allow using nim r hello as it is, without appending the extension. As Nim executable scripts, like bin/fetch or bin/deploy looks much better than bin/fetch.nim or bin/deploy.nim.

#!/usr/bin/env nim c -r

echo "Hi"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions