From 3a88f41096d5a231b6e03cd7916699fa4a775ad2 Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Wed, 18 Feb 2026 06:04:04 +0100 Subject: Improve syncscript Also skip scripts that are identical and add some comments. modified: functions/syncscript.fish --- functions/syncscript.fish | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'functions') diff --git a/functions/syncscript.fish b/functions/syncscript.fish index e1511cf..7b838f8 100644 --- a/functions/syncscript.fish +++ b/functions/syncscript.fish @@ -12,14 +12,21 @@ for script in (find $targetdir -type f -path "*$fishscriptdirs*/*" -name "*.fish set -l basescript (string replace "$targetdir" "$basedir" "$script") + # Skip scripts not present in target tree if not test -e $basescript continue end + # Skip scripts tracked by git if git -C (path dirname $script) ls-files --error-unmatch $script &>/dev/null continue end + # Skip identical scripts + if cmp -s $basescript $script + continue + end + if ask "Copy $basescript to $targetdir?" cp -f --preserve="timestamps,mode" $basescript $script end -- cgit v1.3.1