From a59c4b3955c0d7ff1cf9fb268c169ae9c547516e Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Mon, 13 Aug 2018 20:18:49 -0400 Subject: [PATCH] add check for existing pb command --- fish/.config/fish/functions/pb.fish | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fish/.config/fish/functions/pb.fish b/fish/.config/fish/functions/pb.fish index 0524799..ac7283c 100644 --- a/fish/.config/fish/functions/pb.fish +++ b/fish/.config/fish/functions/pb.fish @@ -1,8 +1,12 @@ function pb - if count $argv > /dev/null - curl -F'file=@'$argv[1] https://0x0.tilde.team + if type -q pb > /dev/null + command pb $argv else - curl -F'file=@-;filename=stdin.txt' https://0x0.tilde.team + if count $argv > /dev/null + curl -F'file=@'$argv[1] https://0x0.tilde.team + else + curl -F'file=@-;filename=stdin.txt' https://0x0.tilde.team + end end end