-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrestore
More file actions
executable file
·35 lines (26 loc) · 964 Bytes
/
restore
File metadata and controls
executable file
·35 lines (26 loc) · 964 Bytes
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
#!/usr/bin/env bash
. "./lib/colors.sh"
function sync_repo() {
local url="$1"
local clone_path="$2"
if [[ -z "${url}" ]] || [[ -z "${clone_path}" ]]; then
echo "${BRed}ERROR${NO_COLOR}: url(${url}) or clone_path(${clone_path})"
caller
exit 1
fi
if [[ -d "${clone_path}" ]]; then
git -C "${clone_path}" pull
else
git clone "${url}" "${clone_path}"
fi
}
DIR_FLAGS=(-ar --human-readable --progress --mkpath)
DOTFILES_DIR="${HOME}/.dotfiles/dotfiles"
rsync "${DIR_FLAGS[@]}" "${DOTFILES_DIR}/.config" "${HOME}"
rsync "${DIR_FLAGS[@]}" "${DOTFILES_DIR}/home/" "${HOME}"
rsync "${DIR_FLAGS[@]}" "${DOTFILES_DIR}/.local" "${HOME}"
sudo rsync "${DIR_FLAGS[@]}" \
"${DOTFILES_DIR}/thumbnailers/" \
"/usr/share/thumbnailers"
sync_repo "https://github.com/mesabytes/nvim-config" "${HOME}/.config/nvim"
sync_repo "https://github.com/mesabytes/awesome-config" "${HOME}/.config/awesome"