this repo has no description

refactor: add `rcopy()` function

+11 -2
+11 -2
ebil.sh
··· 54 54 [[ -d "$1" ]] || die 'path does not exist' 55 55 } 56 56 57 + rcopy() { 58 + local src="$1" 59 + local dst="$2" 60 + shift 61 + shift 62 + 63 + rsync -rltzq --progress "$@" "$src/" "$dst" 64 + } 65 + 57 66 push() { 58 67 local site="$1" 59 68 local path="$2" ··· 70 79 [[ -f "${path}/index.html" ]] || warn 'index.html not found' "(${path}/index.html)" 71 80 72 81 msg 'pushing to' "$site" 'from' "$path" 73 - rsync -rltzq --progress --delete --chmod=D755,F644 "${path}/" "${host}:/var/ebil.club/${name}/${site}" 82 + rcopy "${path}" "${host}:/var/ebil.club/${name}/${site}" --delete --chmod=D755,F644 74 83 } 75 84 76 85 pull() { ··· 88 97 name="${site%.ebil.club}" 89 98 90 99 msg 'pulling from' "$site" 'to' "$path" 91 - rsync -rltzq --progress "${host}:/var/ebil.club/${name}/${site}/" "${path}" 100 + rcopy "${host}:/var/ebil.club/${name}/${site}" "${path}" 92 101 } 93 102 94 103 main() {