1
0
Fork 0
dotfiles/sync
2023-06-19 19:44:07 +04:00

44 lines
1 KiB
Bash
Executable file

#!/bin/sh
# usage:
#
# sudo ./sync
# sudo ./sync gentoo
set -eu
REPO="$(dirname "$(realpath "$0")")"
PREFIX="${1:-''}"
sync() {
prefix="$1"
path="$2"
if [ -f "$path" ]; then
echo cp "$path" "$REPO/$prefix$path"
cp "$path" "$REPO/$prefix$path"
else
echo "Not found: $path"
fi
}
sync common '/etc/tmux.conf'
sync common '/etc/vim/vimrc.local'
sync common '/etc/fish/config.fish'
sync common '/etc/fish/conf.d/rvm.fish'
sync common '/etc/fish/functions/fish_prompt.fish'
sync common '/etc/fish/functions/prompt_user_host.fish'
sync common '/etc/fish/functions/rvm.fish'
if [ "$PREFIX" = 'gentoo' ]; then
echo
sync gentoo '/var/lib/portage/world'
sync gentoo '/etc/portage/make.conf'
sync gentoo '/etc/portage/package.license'
sync gentoo '/etc/portage/package.accept_keywords/package.accept_keywords'
sync gentoo '/etc/portage/package.mask/toolchains'
sync gentoo '/etc/portage/package.use/pluma'
sync gentoo '/etc/portage/package.use/toolchains'
sync gentoo '/etc/portage/package.use/zz-autounmask'
fi