Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/tools/ci/print_toolchain_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
return
fi

VERSION_RAW=$( ($@ --version) 2>&1)

Check failure on line 10 in dist/tools/ci/print_toolchain_versions.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote array expansions to avoid re-splitting elements. [SC2068]
ERR=$?
VERSION=$(echo "$VERSION_RAW" | head -n 1)

Expand All @@ -23,7 +23,7 @@
get_define() {
local cc="$1"
local line=
if command -v "$cc" 2>&1 >/dev/null; then

Check warning on line 26 in dist/tools/ci/print_toolchain_versions.sh

View workflow job for this annotation

GitHub Actions / static-tests

To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify). [SC2069]
line=$(echo "$3" | "$cc" -x c -include "$2" -E -o - - 2>/dev/null | sed -e '/^[ ]*#/d' -e '/^[ ]*$/d')
fi
if [ -z "$line" ]; then
Expand All @@ -37,12 +37,12 @@
}

get_os_info() {
local os="$(uname -s)"

Check warning on line 40 in dist/tools/ci/print_toolchain_versions.sh

View workflow job for this annotation

GitHub Actions / static-tests

Declare and assign separately to avoid masking return values. [SC2155]
local osname="unknown"
local osvers="unknown"
if [ "$os" = "Linux" ]; then
osname="$(cat /etc/os-release | grep ^NAME= | awk -F'=' '{print $2}')"

Check warning on line 44 in dist/tools/ci/print_toolchain_versions.sh

View workflow job for this annotation

GitHub Actions / static-tests

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. [SC2002]
osvers="$(cat /etc/os-release | grep ^VERSION= | awk -F'=' '{print $2}')"

Check warning on line 45 in dist/tools/ci/print_toolchain_versions.sh

View workflow job for this annotation

GitHub Actions / static-tests

Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. [SC2002]
elif [ "$os" = "Darwin" ]; then
osname="$(sw_vers -productName)"
osvers="$(sw_vers -productVersion)"
Expand All @@ -54,7 +54,7 @@
}

extract_shell_version() {
SHELL_NAME=$"(basename $1)"

Check warning on line 57 in dist/tools/ci/print_toolchain_versions.sh

View workflow job for this annotation

GitHub Actions / static-tests

Flip leading $ and " if this should be a quoted substitution. [SC2247]
SHELL_VERSION="$($1 --version 2>/dev/null)"
ERR=$?
if [ $ERR -ne 0 ] ; then # if it does not like the --version switch, it is probably dash
Expand Down Expand Up @@ -112,7 +112,7 @@
printf "\n"
printf "%s\n" "RIOT version information"
printf "%s\n" "----------------------------"
if [ -d .git ]; then
if $(git rev-parse --is-inside-work-tree); then

Check warning on line 115 in dist/tools/ci/print_toolchain_versions.sh

View workflow job for this annotation

GitHub Actions / static-tests

Remove surrounding $() to avoid executing output (or use eval if intentional). [SC2091]
RIOT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
RIOT_COMMIT_HASH=$(git rev-parse HEAD)
RIOT_COMMIT_DATE=$(git log -1 --format=%cd --date=short)
Expand Down