lint.sh: better shebang lint (#33296)

-e
old-commit-hash: 585f362738
pull/33314/head
Maxime Desroches 9 months ago committed by GitHub
parent 35a99d7fc6
commit dc396b6301
  1. 3
      scripts/git_rewrite/rewrite-git-history.sh
  2. 4
      scripts/lint/check_shebang_format.sh
  3. 3
      selfdrive/test/ci_shell.sh

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
SRC=/tmp/openpilot/ SRC=/tmp/openpilot/
SRC_CLONE=/tmp/openpilot-clone/ SRC_CLONE=/tmp/openpilot-clone/

@ -2,12 +2,12 @@
FAIL=0 FAIL=0
if grep '^#!.*python$' $@ | grep -v '#!/usr/bin/env python3$'; then if grep '^#!.*python' $@ | grep -v '#!/usr/bin/env python3$'; then
echo -e "Invalid shebang! Must use '#!/usr/bin/env python3'\n" echo -e "Invalid shebang! Must use '#!/usr/bin/env python3'\n"
FAIL=1 FAIL=1
fi fi
if grep '^#!.*bash$' $@ | grep -v '#!/usr/bin/env bash$'; then if grep '^#!.*bash' $@ | grep -v '#!/usr/bin/env bash$'; then
echo -e "Invalid shebang! Must use '#!/usr/bin/env bash'" echo -e "Invalid shebang! Must use '#!/usr/bin/env bash'"
FAIL=1 FAIL=1
fi fi

@ -1,4 +1,5 @@
#!/bin/bash -e #!/usr/bin/env bash
set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
OP_ROOT="$DIR/../../" OP_ROOT="$DIR/../../"

Loading…
Cancel
Save