aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbm10
1 files changed, 7 insertions, 3 deletions
diff --git a/bm b/bm
index 4573135..93bd8c8 100755
--- a/bm
+++ b/bm
@@ -7,7 +7,6 @@ use File::Basename qw<basename dirname>;
use File::Find qw<find>;
use File::Glob qw<:bsd_glob :nocase>;
use File::Path qw<make_path>;
-use File::Which qw<which>;
use IPC::Open2 qw<open2>;
use List::Util qw<all>;
@@ -16,8 +15,13 @@ use JSON qw<decode_json>;
my $BMDIR = "$ENV{HOME}/.bm";
mkdir $BMDIR || die $!;
-my $YT = which('yt');
-my $GIT = "git -C '$BMDIR'" if which('git') && -d "$BMDIR/.git";
+sub exists_cmd {
+ my $cmd = shift;
+ return `sh -c 'command -v $cmd'`;
+}
+
+my $YT = exists_cmd('yt');
+my $GIT = "git -C '$BMDIR'" if exists_cmd('git') && -d "$BMDIR/.git";
sub is_uri {
my $text = shift;