From 0d1d324e9f6719a5d4198ee0e8efd05cad89fc39 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sun, 8 May 2016 12:08:23 -0700 Subject: only deal with files that exist I noticed while working on an unrelated change that deleting a file caused `make lint` to behave in an unexpected manner. --- build_tools/lint.fish | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'build_tools/lint.fish') diff --git a/build_tools/lint.fish b/build_tools/lint.fish index 5ac05d7d..f40d4c35 100755 --- a/build_tools/lint.fish +++ b/build_tools/lint.fish @@ -54,8 +54,11 @@ else set files (git show --word-diff=porcelain --name-only --pretty=oneline)[2..-1] end - # Extract just the C/C++ files. - set c_files (string match -r '.*\.c(?:pp)?$' -- $files) + # Extract just the C/C++ files that exist. + set c_files + for file in (string match -r '.*\.c(?:pp)?$' -- $files) + test -f $file; and set c_files $c_files $file + end end # We now have a list of files to check so run the linters. -- cgit v1.2.3