-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #441 from GATEOverflow/mlperf-inference
Fixes for get-platform-details
- Loading branch information
Showing
4 changed files
with
26 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
#!/bin/bash | ||
# Safe execution of a command stored in a variable | ||
cmd="${CM_SYS_UTIL_INSTALL_CMD}" | ||
echo "$cmd" | ||
|
||
cmd=${CM_SYS_UTIL_INSTALL_CMD} | ||
echo $cmd | ||
eval $cmd | ||
test $? -eq 0 || exit $? | ||
# Execute the command and capture the exit status directly | ||
if ! eval "$cmd"; then | ||
echo "Command failed with status $?" | ||
if [[ "${CM_TMP_FAIL_SAFE}" == 'yes' ]]; then | ||
# Exit safely if fail-safe is enabled | ||
echo "Fail-safe is enabled, exiting with status 0" | ||
exit 0 | ||
else | ||
# Otherwise exit with the actual error status | ||
exit $? | ||
fi | ||
else | ||
#echo "Command succeeded" | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters