scripts/copy-files

46 lines
983 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env fish
2019-06-07 13:37:33 -07:00
2019-06-29 12:57:32 -07:00
# copy regular files
while read f t
2019-07-12 08:56:12 -07:00
eval set t $t
2020-01-07 08:36:01 -08:00
cp -vr "$t" "$f"
end < files
2019-06-07 13:37:33 -07:00
2019-06-29 13:17:39 -07:00
# copy font configs
function copy-confd -a path out
find $path/*.conf > $out/conflist
2019-06-29 13:17:39 -07:00
2020-01-22 11:11:26 -08:00
rm $out/*.conf
for f in $path/*.conf
if not test -L "$f"
2020-01-07 08:36:01 -08:00
cp -v "$f" "$out"
end
2019-07-12 08:56:12 -07:00
end
2019-06-29 13:17:39 -07:00
end
copy-confd /etc/fonts/conf.d system/fonts/
copy-confd /etc/X11/xorg.conf.d system/xorg/
2019-06-29 12:57:32 -07:00
# copy vim package names
tree -dL 3 ~/.vim/pack > vim/packages
for repo in ~/.vim/pack/*/*/*
2019-07-12 08:56:12 -07:00
pushd $repo
2020-01-07 08:36:01 -08:00
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
2019-07-12 08:56:12 -07:00
popd
2019-07-04 21:25:28 -07:00
end | sort > vim/package_repos
2020-01-07 08:36:01 -08:00
echo
2019-06-29 12:57:32 -07:00
2019-07-22 03:53:26 -07:00
# erase passwords
2020-01-07 08:36:01 -08:00
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