feat(zsh): remove unneded variables add ~/.local/bin to path
This commit is contained in:
@@ -10,23 +10,6 @@ function nvim_ve {
|
||||
|
||||
alias nvim=nvim_ve
|
||||
|
||||
function ffb {
|
||||
if ! [[ -f package.json ]]; then
|
||||
echo "no package.json"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -f yarn.lock ]]; then
|
||||
PACKAGE_MANAGER=yarn
|
||||
else
|
||||
PACKAGE_MANAGER=npm
|
||||
fi
|
||||
|
||||
if [[ -n $(grep "react-scripts" package.json) ]]; then
|
||||
BROWSER=none FORCE_COLOR=true "$PACKAGE_MANAGER" start | cat
|
||||
fi
|
||||
}
|
||||
|
||||
function afm {
|
||||
RES=$(curl -s "https://$1/api/monitoring/requirements")
|
||||
COUNT=$(echo "$RES" | grep -c $2)
|
||||
@@ -71,7 +54,7 @@ function pyinit {
|
||||
|
||||
function lh {
|
||||
if [[ -z $1 ]]; then
|
||||
PORT=8000
|
||||
PORT=7999
|
||||
else
|
||||
PORT=$1
|
||||
fi
|
||||
@@ -87,32 +70,6 @@ function dps {
|
||||
fi
|
||||
}
|
||||
|
||||
function get_dump {
|
||||
if [[ -z $1 ]]; then
|
||||
echo "provide ssh host"
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ -z $2 ]]; then
|
||||
echo "provide dump destination"
|
||||
return
|
||||
fi
|
||||
|
||||
selected=$(ssh "$1" docker ps --format "{{.Names}}" | fzf)
|
||||
|
||||
if [[ -z $selected ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
ssh "$1" docker exec "$selected" pg_dump -U db --format=c db >"$2$(date +'%Y-%m-%dT%H.%M.%S%z')"
|
||||
|
||||
}
|
||||
|
||||
function ggcompile {
|
||||
find -L "$GGROOT" -mindepth 1 -maxdepth 5 -type d -name .git -prune \
|
||||
-exec dirname {} \; >"$GGROOT/compiled"
|
||||
}
|
||||
|
||||
function tssh {
|
||||
if [[ -z $1 ]]; then
|
||||
echo "provide ssh host"
|
||||
@@ -122,17 +79,3 @@ function tssh {
|
||||
ssh -t "$@" "command -v tmux && (tmux a || tmux new-session -s gorazd -c ~) || bash"
|
||||
}
|
||||
|
||||
function ssh-menu {
|
||||
selected=$(
|
||||
grep 'Host .*' ~/.ssh/config \
|
||||
| grep -v '*' \
|
||||
| sed 's/Host \(.*\)/\1/' \
|
||||
| fzf --cycle --bind 'tab:toggle-up,btab:toggle-down'
|
||||
)
|
||||
|
||||
if [[ -z $selected ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
ssh "$selected"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user