@ -249,13 +249,27 @@ reset_device() {
}
}
check_device_port () {
check_device_port () {
if [ -z $DEVICE_PORT ]; then
if [ -z "$DEVICE_PORT" ]; then
echo "Couldn't autodetect the keyboard's serial port."
cat <<EOF >&2
echo "If you see this message and your keyboard is connected to your computer,"
Couldn't autodetect the keyboard's serial port.
echo "it probably means that our serial port detection logic is buggy or incomplete."
If you see this message and your keyboard is connected to your computer,
echo
it probably means that our serial port detection logic is buggy or incomplete.
echo "Please report this issue at https://github.com/keyboardio/Kaleidoscope";
exit 0;
Please report this issue at https://github.com/keyboardio/Kaleidoscope
EOF
exit 1
elif echo "$DEVICE_PORT" | grep -q '[[:space:]]'; then
cat <<EOF >&2
Unexpected whitespace found in detected serial port:
$DEVICE_PORT
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
fi
}
}