From d24f219e3c95bc6c0a8439d6ec3613c824448ca5 Mon Sep 17 00:00:00 2001 From: kamuik16 Date: Sun, 28 Jan 2024 14:31:12 +0530 Subject: [PATCH] feat: detect newly added contracts --- run.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/run.sh b/run.sh index 6cc2388..62c7415 100755 --- a/run.sh +++ b/run.sh @@ -130,6 +130,20 @@ if [ ${#differences[@]} -gt 0 ]; then printf "%s\n" "${differences[@]}" > "storage_delta/.removed" fi +additions=() +for item in "${filesWithPath_new[@]}"; do + skip= + for itemB in "${filesWithPath_old[@]}"; do + [[ $item == $itemB ]] && { skip=1; break; } + done + [[ -n $skip ]] || additions+=("$item") +done + +if [ ${#additions[@]} -gt 0 ]; then + mkdir -p "storage_delta" + printf "%s\n" "${additions[@]}" > "storage_delta/.added" +fi + # ======================================================================== # COMPARE STORAGE LAYOUTS