From 6356154bc3d750ee4544f946583257c90ada04b3 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Thu, 8 Mar 2018 12:03:52 +0000 Subject: [PATCH] add check for DEVICE_PORT being writable If the user has missed the step about setting up their account with the right group membership, they would get a cryptic failure from stty, so catch this and explain the problem. --- bin/kaleidoscope-builder | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/bin/kaleidoscope-builder b/bin/kaleidoscope-builder index 8f4007bb..c95cfb88 100755 --- a/bin/kaleidoscope-builder +++ b/bin/kaleidoscope-builder @@ -268,6 +268,26 @@ If you see this message, it means that our serial port detection logic is buggy or incomplete. Please report this issue at https://github.com/keyboardio/Kaleidoscope +EOF + exit 1 + fi + + if ! [ -w "$DEVICE_PORT" ]; then + cat <&2 + +$DEVICE_PORT is not writable: + + `ls -l $DEVICE_PORT` + +You are currently in the following groups: + + `id -Gn` + +Please ensure you have followed the instructions on setting up your +account to be in the right group: + +https://github.com/keyboardio/Kaleidoscope/wiki/Install-Arduino-support-on-Linux + EOF exit 1 fi