This commit is contained in:
Luk Lu
2023-09-12 13:49:28 +08:00
parent 6f6e75f12b
commit c96f229f93
7 changed files with 51 additions and 18 deletions

View File

@@ -50,7 +50,7 @@ then
homescriptlist=".emacs .emacs.lisp .bashrc .bash_profile .gitignore"
echo
echo "=== Copy or link scripts? <l> to link, <c> to copy, <anything else> to omit:"
echo "=== Copy or link scripts? <l> to link, <c> to copy, <g> to git import, <anything else> to omit:"
read -p ">>> " CopyOrLinkScripts
if [ "$CopyOrLinkScripts" == 'l' ]
then
@@ -67,13 +67,23 @@ then
then
for homescript in $homescriptlist
do
if [ -e "$homescript" ]
if [ -e "$homescript" ] || [ -L "$homescript" ]
then
mv $homescript $homescript.backup-$(date +%Y%m%dT%H%M%S)
fi
echo "--- Copying $NIXHOME/$homescript to $HomePath/$homescript ..."
cp -r $NIXHOME/$homescript ./
done
elif [ "$CopyOrLinkScripts" == 'g' ]
then
for homescript in $homescriptlist
do
if [ -e "$homescript" ] || [ -L "$homescript" ]
then
mv $homescript $homescript.backup-$(date +%Y%m%dT%H%M%S)
fi
curl -sSLO https://git.faronear.org/npm/sysconfig/raw/branch/main/nixhome/$homescript
done
else
echo '--- Home scripts not changed.'
fi