mirror of
https://git.decapod.one/brethil/dotfiles
synced 2024-12-25 00:31:31 +01:00
zsh: cleanup functions
This commit is contained in:
parent
5393f33795
commit
486ee8afbf
|
@ -53,7 +53,7 @@ function ppath
|
|||
## Color string with given color. Usage: `color $NAME "string"`, available colors in `colors.sh`
|
||||
function color
|
||||
{
|
||||
color=$1
|
||||
local color=$1
|
||||
shift 1
|
||||
echo -e "${color}$@${CLEAR}"
|
||||
}
|
||||
|
@ -160,7 +160,7 @@ function genpwd
|
|||
## List defined functions in $DOTFILES/functions.sh
|
||||
function list_functions
|
||||
{
|
||||
grep --color=no -A 1 '^##' $DOTFILES/functions.zsh | sed -E 's/function (.*)/\1/g'
|
||||
grep --color=no -A 1 '^##' $DOTFILES/functions/*.zsh| sed -E 's/function (.*)/\1/g'
|
||||
}
|
||||
|
||||
|
||||
|
@ -191,33 +191,6 @@ if [[ "$(uname)" == "Darwin" ]]; then
|
|||
}
|
||||
fi
|
||||
|
||||
pipupdate(){
|
||||
set -x
|
||||
if [[ "$1" == "user" ]]; then
|
||||
user_flags='--user'
|
||||
shift
|
||||
fi
|
||||
if [[ -n "$@" ]]; then
|
||||
pip="$1"
|
||||
shift
|
||||
flags="$*"
|
||||
echo "pip command is: '$pip $flags'"
|
||||
if ! command -v "$pip" ; then
|
||||
echo "Given command ($1) does not exist." 1>&2
|
||||
return
|
||||
fi
|
||||
|
||||
else
|
||||
pip='python'
|
||||
flags='-m pip'
|
||||
echo "Using default pip: $pip $flags"
|
||||
fi
|
||||
|
||||
for package in $($pip $flags freeze $user_flags --local | grep -v '^\-e' | cut -d = -f 1) ; do
|
||||
$pip $flags install "$user_flags" -U "$package"
|
||||
done
|
||||
set +x
|
||||
}
|
||||
|
||||
# unzip file to directory with the same name of the zip file (without extension)
|
||||
function unzipd {
|
||||
|
@ -244,7 +217,6 @@ function retry() {
|
|||
}
|
||||
|
||||
|
||||
|
||||
__completion_wrapper(){
|
||||
# Wrapper for completion functions.
|
||||
# These can be used to force loading of all completions
|
||||
|
|
Loading…
Reference in New Issue
Block a user