find removed files

This commit is contained in:
q
2025-11-06 15:16:57 +02:00
parent 910fce3163
commit be871b2d7f
2 changed files with 8 additions and 1 deletions

6
rc
View File

@@ -47,6 +47,12 @@ function _q-tools-update-binary {
rm -rf \
"$QTOOLSPATH"/.git \
"$QTOOLSPATH"/current.tar.gz
local obsoleted_file
if [[ -e .removed_files.txt ]]; then
while obsoleted_file; do
echo removing "$obsoleted_file"
done << .removed_files.txt
fi
set +u
fi
fi

View File

@@ -13,7 +13,8 @@ rm -rf .git release.sh
seconds=$(( 10#$( date +%H )*3600 + 10#$( date +%M )*60 + 10#$( date +%S ) ))
version="$( date +%Y%m%d ).$seconds"
echo $version > .version
find . \( -type f -or -type l \) -printf "%P\n" | sort | grep -v \.git > current-files.txt
find . \( -type f -or -type l \) -printf "%P\n" | grep -v \.git > current-files.txt
echo .version >> current-files.txt
git log --pretty=format: --name-status | awk '{ print $2 }' | grep -v ^$ | sort -u > git-files.txt
sort current-files.txt git-files.txt | uniq -c | sed 's/^[[:space:]]*//g' | grep ^1 | awk '{ print $2 }' > .removed_files.txt
rm -f current-files.txt git-files.txt