From 35a6bae1120dbbb5bc3cd4cdbcd8c164d06e04d9 Mon Sep 17 00:00:00 2001 From: nadrad Date: Sun, 23 Jul 2023 11:31:08 +0200 Subject: [PATCH] added pbcopy to acceptable clipboard applications --- install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index a4596f5..f572576 100755 --- a/install.sh +++ b/install.sh @@ -1,7 +1,7 @@ #!/bin/sh HMM_PATH=$(dirname "$0")/h-m-m -MINIMUM_REQUIREMENTS="MINIMUM REQUIREMENTS: PHP 7+ and one of these three must exist on PATH: xclip, xsel or wl-clipboard." +MINIMUM_REQUIREMENTS="MINIMUM REQUIREMENTS: PHP 7+ and one of these three must exist on PATH: xclip, xsel, wl-clipboard, or pbcopy." DESTINATION_DIR=/usr/local/bin # Test if /usr/local/bin exists. If not fallback to /usr/bin @@ -28,9 +28,14 @@ if ! command -v php > /dev/null 2>&1;then exit 1 fi -# Test if xclip, xsel or wl-clipboard are on PATH -if ! command -v xclip > /dev/null 2>&1 && ! command -v xsel > /dev/null 2>&1 && ! command -v wl-clipboard > /dev/null 2>&1 ;then - printf "ERROR: xclip, xsel or wl-clipboard must exist on PATH. Installation cancelled.\n"; +# Test if a clipboard application is available +if \ + ! command -v xclip > /dev/null 2>&1 && \ + ! command -v xsel > /dev/null 2>&1 && \ + ! command -v wl-clipboard > /dev/null 2>&1 \ + ! command -v pbcopy > /dev/null 2>&1 +then + printf "ERROR: xclip, xsel, wl-clipboard, or pbcopy must exist on PATH. Installation cancelled.\n"; printf "%s\n" "$MINIMUM_REQUIREMENTS" exit 1 fi