Skip to content

Commit

Permalink
change command checks to 'type'
Browse files Browse the repository at this point in the history
  • Loading branch information
hamvocke committed Nov 30, 2023
1 parent 0e01fa2 commit 477ac0c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lnks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o pipefail
set -o errexit
set -o nounset

if ! [ -x "$(command -v fzf)" ]; then
if ! type fzf > /dev/null; then
echo "fzf is not installed" >&2
exit 1
fi
Expand All @@ -26,11 +26,11 @@ while [[ "$#" -gt 0 ]]; do
shift
done

if [[ $(grep --no-messages -i Microsoft /proc/version) ]]; then
if type explorer.exe > /dev/null; then
open_command="explorer.exe"
elif [[ "$OSTYPE" == "darwin"* ]]; then
elif type open > /dev/null; then
open_command="open"
elif [[ "$OSTYPE" == "linux"* ]]; then
elif type xdg-open > /dev/null; then
open_command="xdg-open"
fi

Expand Down

0 comments on commit 477ac0c

Please sign in to comment.