[fractal] scripts: Don't check removed files



commit 047e4076c196e557047579cb1bcfb729f6991ad0
Author: Julian Sparber <julian sparber net>
Date:   Thu Jul 21 21:39:02 2022 +0200

    scripts: Don't check removed files

 scripts/checks.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/scripts/checks.sh b/scripts/checks.sh
index 0e7ccabea..48255b4ff 100755
--- a/scripts/checks.sh
+++ b/scripts/checks.sh
@@ -207,7 +207,7 @@ run_rustfmt() {
 
 
     if [[ $git_staged -eq 1 ]]; then
-        staged_files=`git diff --name-only --cached | grep '.rs$'`
+        staged_files=`git diff --name-only --cached | xargs ls -d 2>/dev/null | grep '.rs$'`
         result=0
         for file in ${staged_files[@]}; do
             if ! cargo +nightly fmt -- --unstable-features --skip-children --check $file; then
@@ -284,7 +284,7 @@ run_typos() {
         echo ""
     fi
 
-    staged_files=`git diff --name-only --cached`
+    staged_files=`git diff --name-only --cached | xargs ls -d 2>/dev/null`
 
     if ! typos --color always ${staged_files}; then
         echo -e "  Checking spelling mistakes result: $fail"
@@ -506,7 +506,7 @@ echo ""
 check_potfiles
 echo ""
 if [[ $git_staged -eq 1 ]]; then
-   staged_files=`git diff --name-only --cached | grep data/resources/resources.gresource.xml`
+   staged_files=`git diff --name-only --cached | xargs ls -d 2>/dev/null | grep 
data/resources/resources.gresource.xml`
    if [[ -z $staged_files ]]; then
         check_resources
    fi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]