roc/crates/cli
Jasper Woudenberg ad555297cf
Set argv[0] to .roc file passed to 'roc run'
When we run `roc run <file>` or `roc <file>` then Roc will compile a
binary and run it. Before this commit we would set the path to the
compiled binary as argv[0]. This commit changes the behavior to make
argv[0] in the binary correspond to the roc file being ran.

This benefits the use of roc scripts that make use of a shebang:

    #!/usr/bin/env roc

With this change such scripts will be able to read the path to
themselves out of ARGV. This trick is commonly used for instance by bash
scripts in order to access files relative to the script itself.
2024-10-21 21:54:46 +02:00
..
benches fixed filenames 2023-12-27 15:58:03 +01:00
src Set argv[0] to .roc file passed to 'roc run' 2024-10-21 21:54:46 +02:00
tests Set argv[0] to .roc file passed to 'roc run' 2024-10-21 21:54:46 +02:00
build.rs Add commit information to roc versions built from source 2024-09-25 21:12:46 +08:00
Cargo.toml Add commit information to roc versions built from source 2024-09-25 21:12:46 +08:00