From 463c9e14c49e19a1a2570f6751213d5cb1d76ec5 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 17 Mar 2021 19:13:34 +0100 Subject: [PATCH] Print only the files that are in a directory but not in the other one --- check-submodules.sh | 5 +++-- check-tree-sitter-crates.sh | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/check-submodules.sh b/check-submodules.sh index 2441bc0cd..5156dba02 100755 --- a/check-submodules.sh +++ b/check-submodules.sh @@ -44,10 +44,11 @@ echo "$SUBMODULE_NAME-old: $OLD" echo "$SUBMODULE_NAME-new: $NEW" # If metrics directories differ in number of files, -# print the difference of files +# print only the files that are in a directory but not in the other one if [ $OLD != $NEW ] then - diff -rq /tmp/$SUBMODULE_NAME-old /tmp/$SUBMODULE_NAME-new + ONLY_FILES=`diff -q /tmp/$SUBMODULE_NAME-old /tmp/$SUBMODULE_NAME-new | grep "Only in"` + echo "$ONLY_FILES" fi # Compare metrics diff --git a/check-tree-sitter-crates.sh b/check-tree-sitter-crates.sh index 18a2d29a2..3b1e13242 100755 --- a/check-tree-sitter-crates.sh +++ b/check-tree-sitter-crates.sh @@ -76,10 +76,11 @@ echo "$TREE_SITTER_CRATE-old: $OLD" echo "$TREE_SITTER_CRATE-new: $NEW" # If metrics directories differ in number of files, -# print the difference of files +# print only the files that are in a directory but not in the other one if [ $OLD != $NEW ] then - diff -rq /tmp/$TREE_SITTER_CRATE-old /tmp/$TREE_SITTER_CRATE-new + ONLY_FILES=`diff -q /tmp/$TREE_SITTER_CRATE-old /tmp/$TREE_SITTER_CRATE-new | grep "Only in"` + echo "$ONLY_FILES" fi # Compare metrics