Guard against the deletion of files that are already deleted

On a second run where the first run was partially completed, the
deleted files might not exist anymore. This change guards against
trying to delete such files.
This commit is contained in:
0x1eef 2023-05-29 00:03:46 -03:00
parent 43d5183147
commit 70c1ab4ca2

View file

@ -9,8 +9,10 @@ __install_update() {
ch_files=$(git diff --name-only --diff-filter=RAM "$rev"..HEAD | \ ch_files=$(git diff --name-only --diff-filter=RAM "$rev"..HEAD | \
cut -d / -f1 -f2 | uniq) cut -d / -f1 -f2 | uniq)
for file in $rm_files; do for file in $rm_files; do
echo RM "$ports_dir/$file" if [ -e "$ports_dir/$file" ]; then
rm "$ports_dir/$file" echo RM "$ports_dir/$file"
rm "$ports_dir/$file"
fi;
done done
for file in $ch_files; do for file in $ch_files; do
if [ -f "$file" ]; then if [ -f "$file" ]; then