From 94790f8db99e01a5d5d1923b331aa0fe444ca776 Mon Sep 17 00:00:00 2001 From: Jason Koh Date: Mon, 4 May 2020 15:13:24 -0700 Subject: [PATCH] Make sure the macOS device prober only runs if you've supplied the required args Signed-off-by: Jesse Vincent --- bin/find-device-port-macos | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/find-device-port-macos b/bin/find-device-port-macos index ed799355..484d7355 100644 --- a/bin/find-device-port-macos +++ b/bin/find-device-port-macos @@ -10,6 +10,10 @@ use strict; my $vid = shift @ARGV; my $pid = shift @ARGV; +if (!defined $vid || !defined $pid) { + die "$0 has two required parameters, VID and PID"; +} + # ioreg might be more machine-readable than system_profiler, but I haven't been able to # get it to produce useful output my @output = qx(/usr/sbin/system_profiler SPUSBDataType 2> /dev/null);