tangled
alpha
login
or
join now
robinwobin.dev
/
ebil
1
fork
atom
this repo has no description
1
fork
atom
overview
issues
pulls
pipelines
refactor: add `rcopy()` function
robinwobin.dev
1 month ago
c1c58d20
b2bea425
+11
-2
1 changed file
expand all
collapse all
unified
split
ebil.sh
+11
-2
ebil.sh
···
54
54
[[ -d "$1" ]] || die 'path does not exist'
55
55
}
56
56
57
57
+
rcopy() {
58
58
+
local src="$1"
59
59
+
local dst="$2"
60
60
+
shift
61
61
+
shift
62
62
+
63
63
+
rsync -rltzq --progress "$@" "$src/" "$dst"
64
64
+
}
65
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
73
-
rsync -rltzq --progress --delete --chmod=D755,F644 "${path}/" "${host}:/var/ebil.club/${name}/${site}"
82
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
91
-
rsync -rltzq --progress "${host}:/var/ebil.club/${name}/${site}/" "${path}"
100
100
+
rcopy "${host}:/var/ebil.club/${name}/${site}" "${path}"
92
101
}
93
102
94
103
main() {