shpec relies on shebang fallback, fails on fish
trying to run with fish fails with:
fish_1 | Failed to execute process '/usr/local/bin/shpec'. Reason:
fish_1 | exec: unknown error (errno was 8)
fish_1 | The file '/usr/local/bin/shpec' is marked as an executable but could not be run by the operating system.
Hi @typekpb, this is due to two things: a) fish not having a compatibility shim, and b) shpec relying on said shim to function.
There's a good writeup on the history in a fish issue with a very similar error: https://github.com/fish-shell/fish-shell/issues/1281#issuecomment-265788224. There's been some related discussion on #87 (particularly my most recent comment if you're interested), but I think the summary is as follows:
When used as prescribed, shpec will, in the majority of cases, be executed by /bin/sh due to the compatibility shim. In the rest of the cases (e.g. yours), it will just fail.
I frankly see no reason not to have a shebang of /bin/sh. This would fix said issue with fish (and any other shell that does not have the shim) while still allowing us to test shpec's POSIX compliance by executing shpec manually with other shells (to simulate one doing the same, or having set their /bin/sh to said shell).
@typekpb I've modified your issue name to be more general. This should be a one-line fix; please do submit a PR if you're feeling helpful :wink: