-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsyncdot.sh
executable file
·52 lines (47 loc) · 1.29 KB
/
syncdot.sh
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
#!/usr/bin/env bash
set -e
: "${XDG_CONFIG_HOME:-"${HOME}/.config"}/proxy"
if [[ -f "$_" ]]; then
source "$_"
fi
sudo bash -c "${PM_UPDATE:-"apt update && apt upgrade -y"}"
pushd "${DOT:-"${HOME}/.dotfiles"}"
git pull && git submodule update --init
bash update.bash "$@"
popd
linux="${GOOGLE_DRIVE}/Config/Linux"
cfg="${XDG_CONFIG_HOME:-"${HOME}/.config"}"
ranger="${cfg}/ranger"
if [[ -e "${ranger}" ]]; then
pushd "${ranger}" && git pull
: "${linux}" && [[ -d "$_" ]] && rsync -ahCP --del \
-f "-s __pycache__/" "${ranger}" "$_"
popd
fi
aria2="${cfg}/aria2"
if [[ -e "${aria2}" ]]; then
pushd "${aria2}" && git pull
: "${linux}" && [[ -d "$_" ]] && rsync -ahCP --del "${aria2}" "$_"
popd
fi
lib="${HOME}/.local/lib"
scripts="${lib}/scripts"
if [[ -e "${scripts}" ]]; then
pushd "${scripts}" && git pull
: "${linux}/bin" && [[ -d "$_" ]] && rsync -ahCP --del "${scripts}/" "$_"
popd
fi
wsl_scripts="${lib}/wsl-scripts"
if [[ -e "${wsl_scripts}" ]]; then
pushd "${wsl_scripts}" && git pull
: "${linux}/wsl" && [[ -d "$_" ]] && rsync -ahCP --del "${wsl_scripts}/" "$_"
popd
fi
copyq="${cfg}/copyq"
if [[ -e "${copyq}" && -d "${linux}" ]]; then
rsync -ahCP --del "${copyq}" "${linux}"
fi
gist="${HOME}/.local/lib/gist"
if [[ -d "${gist}" ]]; then
pushd "${gist}" && git pull && popd
fi