Skip to content

chore(scripts): use env for bash/sh shebangs in dev and CI scripts - #16425

Draft
karlskewes wants to merge 2 commits into
grafana:mainfrom
karlskewes:fix-script-shebangs
Draft

chore(scripts): use env for bash/sh shebangs in dev and CI scripts#16425
karlskewes wants to merge 2 commits into
grafana:mainfrom
karlskewes:fix-script-shebangs

Conversation

@karlskewes

Copy link
Copy Markdown
Contributor

What's Changed

  • use #!/usr/bin/env bash or #!/usr/bin/env sh instead of hardcoded interpreter paths
  • fixes bad interpreter failures on systems without /bin/bash, e.g. NixOS
  • covers development compose scripts, CI workflow scripts, and operations tooling scripts
  • leaves scripts unchanged that only run inside built container images or as packaging maintainer scripts

Hardcoded #!/bin/bash and #!/bin/sh shebangs fail on systems where
those interpreters aren't at that exact path, e.g. NixOS, which does
not put bash at /bin/bash. Use /usr/bin/env to resolve the interpreter
from PATH instead. Scripts that only run inside built container images
or as packaging maintainer scripts are left unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant