voxl-send-command exit status implementation request
-
Super super low priority but I noticed that voxl-send-command doesn't output a return code. Even on an error can look like a success since echo will return exit status 0. This is particularly frustrating when an error does actually occur.
scripts/voxl-send-command · master · voxl / VOXL SDK / Utilities / voxl-mpa-tools · GitLab
Tools and utilities specific to MPA.
GitLab (gitlab.com)
Here is a fix below:
if [ -p "/run/mpa/${1}/control" ]; then _CONTROL_FILE="/run/mpa/${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 elif [ -p "${1}/control" ]; then _CONTROL_FILE="${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 else echo "Unable to find valid pipe that accepts control commands at: ${1}" exit 1 fiWould love to see an update here!
Also side note: Let me know if this is the proper channel so submit code issues like these.
-
Super super low priority but I noticed that voxl-send-command doesn't output a return code. Even on an error can look like a success since echo will return exit status 0. This is particularly frustrating when an error does actually occur.
scripts/voxl-send-command · master · voxl / VOXL SDK / Utilities / voxl-mpa-tools · GitLab
Tools and utilities specific to MPA.
GitLab (gitlab.com)
Here is a fix below:
if [ -p "/run/mpa/${1}/control" ]; then _CONTROL_FILE="/run/mpa/${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 elif [ -p "${1}/control" ]; then _CONTROL_FILE="${1}/control" shift echo "$@" >> "$_CONTROL_FILE" echo "Successfully sent command to ${_CONTROL_FILE}" exit 0 else echo "Unable to find valid pipe that accepts control commands at: ${1}" exit 1 fiWould love to see an update here!
Also side note: Let me know if this is the proper channel so submit code issues like these.
@jameskuesel Feel free to make the change and submit a PR
-
@jameskuesel Feel free to make the change and submit a PR
Sorry my bad! Done!
-
Sorry my bad! Done!
@jameskuesel Thanks! Merged
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login