1
0
Fork 0
dotfiles/sync

44 lines
1,012 B
Text
Raw Normal View History

2023-04-19 16:04:25 -04:00
#!/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/toolchains'
sync gentoo '/etc/portage/package.use/zz-autounmask'
fi