scripts/copy-files

46 rindas
983 B
Fish
Executable File

#!/usr/bin/env fish
# copy regular files
while read f t
eval set t $t
cp -vr "$t" "$f"
end < files
# copy font configs
function copy-confd -a path out
find $path/*.conf > $out/conflist
rm $out/*.conf
for f in $path/*.conf
if not test -L "$f"
cp -v "$f" "$out"
end
end
end
copy-confd /etc/fonts/conf.d system/fonts/
copy-confd /etc/X11/xorg.conf.d system/xorg/
# copy vim package names
tree -dL 3 ~/.vim/pack > vim/packages
for repo in ~/.vim/pack/*/*/*
pushd $repo
echo -n (basename $PWD)" " | tee /dev/stderr
if test -d .git
echo "<"(git config --get remote.(git rev-parse --abbrev-ref "master@{upstream}" | sed 's/\(.*\)\/.*/\1/').url)">"
else
echo "<no url>"
end
popd
end | sort > vim/package_repos
echo
# erase passwords
function erasepw -a inp out
sed -i "$inp" "$out"
echo "$out"
end
erasepw 's/password>.*<\//password>password removed<\//g' network/icecast.xml
erasepw 's/password\(\s*\)".*"/password\1"password removed"/g' network/mpd.conf