nushell/crates/nu-command
Jelle Besseling a7c1b363eb
Don't run .sh files with /bin/sh (#8951)
# Description

The previous behaviour broke for me because I didn't have `sh` in my
path for my nu script. I think we shouldn't assume that just because a
file ends with `.sh` it should be executed with `sh`. `sh` might not be
available or the script might contain a hashbang for a different shell.

The idea with this PR is that nushell shouldn't assume anything about
executable files and just execute them. Later on we can think about how
non-executable files should be executed if we detect they are a script.

# User-Facing Changes

This may break some people's scripts or habits if they have wrong
assumptions about `.sh` files. We can tell them to add a hashbang and +x
bit to execute shell scripts, or prepend `bash`. If this a common
assumption something like this should be added to the book

# Tests + Formatting

I only tested manually and that did work

# After Submitting

Co-authored-by: Jelle Besseling <jelle@bigbridge.nl>
2023-05-02 17:56:35 -05:00
..
assets refactor html module (#5246) 2022-04-20 08:50:14 -05:00
src Don't run .sh files with /bin/sh (#8951) 2023-05-02 17:56:35 -05:00
tests Add --redirect-combine option to run-external (#8918) 2023-04-28 07:55:48 -05:00
Cargo.toml Add --redirect-combine option to run-external (#8918) 2023-04-28 07:55:48 -05:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00