phpsg.sh: Remove files which are no longer found in SOURCE_DIR.
This commit is contained in:
parent
1afa6886ed
commit
a32d24a086
10
phpsg.sh
10
phpsg.sh
@ -116,3 +116,13 @@ export -f process_file
|
||||
|
||||
find "$SOURCE_DIR" -type f -not -name '*.cfg.php' |
|
||||
parallel -j"${JOBS}" process_file
|
||||
|
||||
SOURCE_FILE_LIST=$(cd "$SOURCE_DIR" && find . -type f -and -not -name '*.cfg.php' | sed 's/.php$//')
|
||||
OUTPUT_FILE_LIST=$(cd "$OUTPUT_DIR" && find . -type f)
|
||||
|
||||
for file in $(echo "${SOURCE_FILE_LIST[@]}" "${OUTPUT_FILE_LIST[@]}" | tr ' ' '\n' | sort | uniq -u)
|
||||
do
|
||||
FILE_PATH=$(realpath --relative-base=./ "$OUTPUT_DIR/$file")
|
||||
echo "Deleting file $FILE_PATH"
|
||||
rm "$FILE_PATH"
|
||||
done
|
||||
|
Loading…
x
Reference in New Issue
Block a user