Skip to content

Instantly share code, notes, and snippets.

@cfillion
Created September 21, 2019 21:59
Show Gist options
  • Select an option

  • Save cfillion/bd0a9d40b8f1b02b99968ed45a96fefb to your computer and use it in GitHub Desktop.

Select an option

Save cfillion/bd0a9d40b8f1b02b99968ed45a96fefb to your computer and use it in GitHub Desktop.
Wrapper to make mpasmx output errors to stderr and fail with a proper exit code
#!/bin/sh
errfile="$(mktemp)"
exit=0
/opt/microchip/mplabx/v*.*/mpasmx/mpasmx -e"$errfile" "$@"
if [ -s "$errfile" ]; then
cat "$errfile" >&2
exit=1
fi
rm "$errfile"
exit "$exit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment