mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 06:23:53 +01:00
dist/tools: parse version info from stderr
Currently version information of commands and tools is only parsed from STDOUT, however some tools like openocd print version info to STDERR only. This commits adds parsing of STDERR for version infos if STDOUT does not contain such info.
This commit is contained in:
parent
1f2985dfc6
commit
424830b06b
4
dist/tools/ci/print_toolchain_versions.sh
vendored
4
dist/tools/ci/print_toolchain_versions.sh
vendored
@ -8,6 +8,10 @@ get_cmd_version() {
|
||||
local cmd="$1"
|
||||
if command -v "$cmd" 2>&1 >/dev/null; then
|
||||
ver=$("$cmd" --version 2> /dev/null | head -n 1)
|
||||
# some tools (eg. openocd) print version info to stderr
|
||||
if [ -z "$ver" ]; then
|
||||
ver=$("$cmd" --version 2>&1 | head -n 1)
|
||||
fi
|
||||
if [ -z "$ver" ]; then
|
||||
ver="error"
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user