koalaman / shellcheck

ShellCheck, a static analysis tool for shell scripts
https://www.shellcheck.net
GNU General Public License v3.0
36.33k stars 1.77k forks source link

Please support with-contenv shebang from s6-overlay #1760

Open nemchik opened 4 years ago

nemchik commented 4 years ago

For new checks and feature suggestions

Here's a snippet or screenshot that shows the problem:

#!/usr/bin/with-contenv sh
echo "$MYENV"

Here's what shellcheck currently says:

From shellcheck.net

$ shellcheck myscript

Line 1:
#!/usr/bin/with-contenv sh
^-- SC1008: This shebang was unrecognized. ShellCheck only supports sh/bash/dash/ksh. Add a 'shell' directive to specify.

$

Here's what I wanted or expected to see:

It would be nice if this did not require ignoring SC1008.

Ref links https://github.com/just-containers/s6-overlay/blob/master/README.md#container-environment https://github.com/just-containers/s6-overlay/blob/master/builder/overlay-rootfs/usr/bin/with-contenv

nemchik commented 2 years ago

Just an FYI, s6 overlay has changed from /usr/bin/with-contenv to /command/with-contenv although they offer a symlink for the original path, so it would be great if both could be supported. The new file location in their repository is https://github.com/just-containers/s6-overlay/blob/master/layout/rootfs-overlay/package/admin/s6-overlay-%40VERSION%40/command/with-contenv