commit | 687d8413a457781599298b8c1f7724e07be62d47 | [log] [tgz] |
---|---|---|
author | Jinliang Wang <jinliangw@google.com> | Thu Apr 20 15:54:10 2023 -0700 |
committer | Jinliang Wang <jinliangw@google.com> | Thu Apr 20 16:04:49 2023 -0700 |
tree | 467cba90664c3cf5d7573a6a4208d1b9b7def10b | |
parent | 5293ec2e5750456f705b6c06dcb7a4a106e4b296 [diff] [blame] |
fix shellcheck failure detected by CI Found that failure at https://jenkins.openbmc.org/job/ci-repository/64626/console : Running shellcheck In tools/fan_rpm_loop_unittest.sh line 48: main "$@" ^-------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). In tools/fan_rpm_loop_test.sh line 88: main "$@" ^-------^ SC2317 (info): Command appears to be unreachable. Check usage (or ignore if invoked indirectly). For more information: https://www.shellcheck.net/wiki/SC2317 -- Command appears to be unreachable... shellcheck: FAILED Apply the trick in https://superuser.com/questions/731425/bash-detect-execute-vs-source-in-a-script to detect execute vs sourve environment. Change-Id: I6bea34c91c423e50101e397efb63c436c66e0587 Signed-off-by: Jinliang Wang <jinliangw@google.com>
diff --git a/tools/fan_rpm_loop_test.sh b/tools/fan_rpm_loop_test.sh index 3d38ea6..5c56878 100755 --- a/tools/fan_rpm_loop_test.sh +++ b/tools/fan_rpm_loop_test.sh
@@ -84,5 +84,7 @@ RunRpmSteps "${max_rpm}" "${min_rpm}" 1 30 } -return 0 2>/dev/null -main "$@" +if [ "$0" = "${BASH_SOURCE[0]}" ]; then + # not sourced, execute main function + main "$@" +fi