blob: d6319bb82aa70d4806edc1ca24b3f7eb242363ed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#!/usr/bin/env zsh
set -o shwordsplit
target="$HOME/personal"
log() {
if [[ $dry == "1" ]]; then
echo "[DRY_RUN]: $@"
else
echo "$@"
fi
}
execute() {
log "execute $@"
if [[ $dry == "1" ]]; then
return
fi
"$@"
}
copy_dir() {
from=$1
to=$2
name=$(basename $from)
execute rm -rf $to/$name
execute cp -r $from $to/$name
}
copy_file() {
from=$1
to=$2
name=$(basename $from)
execute rm $to/$name
execute cp $from $to/$name
}
|