(bashrc/navigate) added checks and aliases for pushd/popd if navigate does not exist
This commit is contained in:
@@ -27,6 +27,11 @@ fi
|
|||||||
#bind -r "\C-l"
|
#bind -r "\C-l"
|
||||||
|
|
||||||
# define aliases
|
# define aliases
|
||||||
|
if ! $(which navigate &>/dev/null); then
|
||||||
|
alias push='pushd'
|
||||||
|
alias pop='popd'
|
||||||
|
fi
|
||||||
|
|
||||||
alias ls='ls -hal --color=auto'
|
alias ls='ls -hal --color=auto'
|
||||||
if $(which eza &>/dev/null); then
|
if $(which eza &>/dev/null); then
|
||||||
alias list='eza -lao --no-permissions --group-directories-first -s=ext --color=always --time-style long-iso'
|
alias list='eza -lao --no-permissions --group-directories-first -s=ext --color=always --time-style long-iso'
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if ! $(which navigate &>/dev/null); then
|
||||||
|
printf "\033[0;31mcould not find 'navigate' on path" >&2
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
function __call_navigate {
|
function __call_navigate {
|
||||||
arg_pid=" --pid $$ "
|
arg_pid=" --pid $$ "
|
||||||
eval "$(navigate ${arg_pid} $@)"
|
eval "$(navigate ${arg_pid} $@)"
|
||||||
|
|||||||
Reference in New Issue
Block a user