fixed cp again and made some changes

This commit is contained in:
pika 2024-09-12 19:01:37 +02:00
parent 1b216d4cfb
commit d27b0073db

32
.zshrc
View file

@ -313,7 +313,10 @@ drweb() {
git clone --depth=1 "https://github.com/$1"
}
gck() {
git clone --depth=1 "https://git.k4li.de/$1"
git clone --recurse-submodules --depth=1 "https://git.k4li.de/$1"
}
gcs() {
git clone --recurse-submodules --depth=1 "git@git.k4li.de:$1"
}
alias gd="git diff"
alias ga="gd $1 && git add"
@ -392,32 +395,14 @@ _coding_() {
npm run "$env" -- --host="$(get_ip)" --port="$port"
}
# alias npmrun='npm run "$1" -- --host=$(get_ip) --port=8001'
fi
}
# ─< rsync >────────────────────────────────────────────────────────────────────────────────
_rsync_() {
_rrsync() {
if command_exists find; then
numbers=0
for source in "${@:1:$#-1}"; do
numbers=$(($numbers + $(find "$source" -type f | wc -l)))
done
destination="${@: -1}"
rsync -avP --info=progress2 "${@:1:$#-1}" "$destination" | pv -lpes $numbers
else
echo_error "-- We could not find 'find'. Please install 'find' to enable the progress bar. (hit 'CTRL + C' to exit now) --"
sleep 5
rsync -avP --info=progress2 "$@"
fi
}
if command_exists rsync; then
alias cp="_rrsync"
alias scp="rsync -avP"
fi
}
if command_exists rsync; then
alias scp="rsync -avP"
alias cp="scp"
fi
get_packager() {
search=""
@ -506,7 +491,6 @@ main(){
_init
_alias
_coding_
_rsync_
}
if check_root; then
main