Skip to content

Commit

Permalink
Fix some error cases in run-sonata.sh.
Browse files Browse the repository at this point in the history
1) In helper_find_llvm_install the error message was captured by $() so not visible, so print it to stderr instead.
2) Since set -e is on if command -v uf2conv failed the script would exit without printing an error.
  • Loading branch information
rmn30 committed Jan 15, 2025
1 parent bea973d commit dc1e78b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/includes/helper_find_llvm_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ find_llvm_tool_required() {
LLVM_TOOL=$(find_llvm_tool $1)

if [ ! -x ${LLVM_TOOL} ] ; then
echo Unable to locate $1, please set TOOLS_PATH to the directory containing the LLVM toolchain.
echo Unable to locate $1, please set TOOLS_PATH to the directory containing the LLVM toolchain. >&2
exit 1
fi

Expand Down
4 changes: 2 additions & 2 deletions scripts/run-sonata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ SCRIPT_DIRECTORY="$(dirname "$(realpath "$0")")"

OBJCOPY=$(find_llvm_tool_required llvm-objcopy)

command -v uf2conv > /dev/null
if [ ! $? ] ; then
if ! command -v uf2conv > /dev/null ; then
echo "uf2conv not found. On macOS / Linux systems with Python3 installed, you can install it with:"
echo "python3 -m pip install --pre -U git+https://github.com/makerdiary/uf2utils.git@main"
exit 1
fi

# Convert the ELF file to a binary file
Expand Down

0 comments on commit dc1e78b

Please sign in to comment.