Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
scripts: Make collect script error if runtime not found
Browse files Browse the repository at this point in the history
Changed data/cc-collect-data.sh.in so that if the runtine cannot
be found, it immediately errors.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
  • Loading branch information
jodh-intel committed Oct 2, 2017
1 parent 34d4058 commit b72b2bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data/cc-collect-data.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
# report to help developers diagnose problems.

script_name=${0##*/}
runtime=$(which "cc-runtime")
runtime_name="cc-runtime"
runtime=$(command -v "$runtime_name" 2>/dev/null)
script_version="@VERSION@ (commit @COMMIT@)"

die()
Expand Down Expand Up @@ -242,6 +243,7 @@ show_runtime()
main()
{
[ $(id -u) -eq 0 ] || die "Need to run as root"
[ -n "$runtime" ] || die "cannot find runtime '$runtime_name'"

show_meta
show_runtime
Expand Down

0 comments on commit b72b2bd

Please sign in to comment.