-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-env
More file actions
executable file
·65 lines (51 loc) · 1.08 KB
/
dev-env
File metadata and controls
executable file
·65 lines (51 loc) · 1.08 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env bash
script_dir="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
dry="0"
while [[ $# > 0 ]]; do
if [[ $1 == "--dry" ]]; then
dry="1"
fi
shift
done
log() {
if [[ $dry == "1" ]]; then
echo "[DRY_RUN]: $@"
else
echo "$@"
fi
}
execute(){
log "execute $@"
if [[ $dry == "1" ]]; then
return
fi
"$@"
}
cd $script_dir
copy_dir() {
pushd $1
form=$1
to=$2
dirs=$(find . -mindepth 1 -maxdepth 1 -type d)
for dir in $dirs; do
execute rm -rf $to/$dir
execute cp -r $dir $to/$dir
done
popd > /dev/null
}
copy_file() {
from=$1
to=$2
name=$(basename $from)
execute rm $to/$name
execute cp $from $to/$name
}
log "----------------- dev-env ---------------"
copy_dir .config $HOME/.config
# copy_file .spconf $HOME
# additional configs
copy_file .config/google-chrome-flags.conf $HOME/.config
copy_file .config/chrome-flags.conf $HOME/.config
copy_file .config/microsoft-edge-stable-flags.conf ~/.config
copy_file .config/kwalletrc ~/.config
# Home Dir configs