From 89d517fe40092e2906ae139d439908010329fbe2 Mon Sep 17 00:00:00 2001 From: TheK4n Date: Tue, 24 Jan 2023 13:02:31 +0300 Subject: [PATCH] change depricated which to command -v --- sub/bash/aliases | 2 +- sub/bash/functions | 2 +- sub/bash/prompt | 2 +- sub/nvim/lua/base/keys/keys.lua | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sub/bash/aliases b/sub/bash/aliases index a611347..8c32716 100644 --- a/sub/bash/aliases +++ b/sub/bash/aliases @@ -1,7 +1,7 @@ # colors -if [ -x "$(which dircolors)" ]; then +if [ -x "$(command -v dircolors)" ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias grep='grep --color=auto' diff --git a/sub/bash/functions b/sub/bash/functions index a87fa00..770bd3b 100644 --- a/sub/bash/functions +++ b/sub/bash/functions @@ -152,7 +152,7 @@ docker_ips() { py() { - if [ -z "$@" -a -n "$(which ipython)" ]; then + if [ -z "$@" -a -x "$(command -v ipython)" ]; then ipython -i -c "q = exit" else python3 $@ diff --git a/sub/bash/prompt b/sub/bash/prompt index 0b1e3fb..f043ca6 100644 --- a/sub/bash/prompt +++ b/sub/bash/prompt @@ -1,7 +1,7 @@ parse_git_branch() { - if ! [ -x "$(which git)" ]; then + if ! [ -x "$(command -v git)" ]; then return fi diff --git a/sub/nvim/lua/base/keys/keys.lua b/sub/nvim/lua/base/keys/keys.lua index 2ea9027..77c3454 100644 --- a/sub/nvim/lua/base/keys/keys.lua +++ b/sub/nvim/lua/base/keys/keys.lua @@ -67,7 +67,7 @@ map("c", '%%', [[getcmdtype() == ':' ? expand('%:h').'/' : '%%']], {expr = true} -- Save from root -vim.api.nvim_create_user_command('Sw', [[execute 'silent! write !SUDO_ASKPASS=$(which vim_askpass_helper) sudo -A tee % >/dev/null']], {}) +vim.api.nvim_create_user_command('Sw', [[execute 'silent! write !SUDO_ASKPASS=$(command -v vim_askpass_helper) sudo -A tee % >/dev/null']], {})