Skip to content

Commit

Permalink
update bash scripts to #!/usr/bin/env bash (commaai#1987)
Browse files Browse the repository at this point in the history
* update bash shebang for better compatibility including macOS

* can't have anything after #bash
  • Loading branch information
andiradulescu authored Aug 27, 2024
1 parent 2b94e4f commit 0a09122
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion board/debug/debug_h7.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash -e
#!/usr/bin/env bash
set -e

sudo openocd -f "interface/stlink.cfg" -c "transport select hla_swd" -f "target/stm32h7x.cfg" -c "init"
2 changes: 1 addition & 1 deletion board/gdb.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
#!/usr/bin/env bash

gdb-multiarch --eval-command="target extended-remote localhost:3333"
2 changes: 1 addition & 1 deletion drivers/spi/load.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/pull-src.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down
2 changes: 1 addition & 1 deletion release/make_release.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down
3 changes: 2 additions & 1 deletion tests/ci_shell.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash -e
#!/usr/bin/env bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
OP_ROOT="$DIR/../../"
Expand Down
2 changes: 1 addition & 1 deletion tests/hitl/run_parallel_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down
2 changes: 1 addition & 1 deletion tests/hitl/run_serial_tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down
2 changes: 1 addition & 1 deletion tests/misra/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down
4 changes: 2 additions & 2 deletions tests/misra/test_misra.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
Expand Down Expand Up @@ -51,7 +51,7 @@ cppcheck() {
--suppress=*:*include/* --error-exitcode=2 --check-level=exhaustive \
--platform=arm32-wchar_t4 $COMMON_DEFINES --checkers-report=$CHECKLIST.tmp \
--std=c11 "$@" |& tee $OUTPUT

cat $CHECKLIST.tmp >> $CHECKLIST
rm $CHECKLIST.tmp
# cppcheck bug: some MISRA errors won't result in the error exit code,
Expand Down
2 changes: 1 addition & 1 deletion tests/read_st_flash.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
rm -f /tmp/dump_bootstub
rm -f /tmp/dump_main
dfu-util -a 0 -s 0x08000000 -U /tmp/dump_bootstub
Expand Down
4 changes: 2 additions & 2 deletions tests/setup_device_ci.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash

set -e

Expand All @@ -19,7 +19,7 @@ fi

CONTINUE_PATH="/data/continue.sh"
tee $CONTINUE_PATH << EOF
#!/usr/bin/bash
#!/usr/bin/env bash
sudo abctl --set_success
Expand Down
2 changes: 1 addition & 1 deletion tests/som_debug.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
set -e

DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
Expand Down

0 comments on commit 0a09122

Please sign in to comment.