From b675ff29029ef16b3de9cbaf7e4a6911ab231605 Mon Sep 17 00:00:00 2001 From: Jason Koh Date: Mon, 4 May 2020 15:18:08 -0700 Subject: [PATCH] Make our hail-mary logic a little more flexible. (Jason's original implementation just truncated the $sn, no matter what. I modified it slightly.) Signed-off-by: Jesse Vincent --- bin/find-device-port-macos | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/find-device-port-macos b/bin/find-device-port-macos index 484d7355..b33a1e82 100644 --- a/bin/find-device-port-macos +++ b/bin/find-device-port-macos @@ -77,6 +77,8 @@ sub try_for_location_id { sub try_for_sn_prefix { my $sn = shift; + # If macOS has appended 'E', take it off to maximise our chances of a match. + $sn =~ s/E$//; # If none of the above tests succeeds, just list the directory and see if there are any # files that have the device shortname that we expect: