Message ID | 8d9f9d06aabb924ad458a6e4084c2668a4677059.1490091134.git.jani.nikula@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Mar 21, 2017 at 12:14:33PM +0200, Jani Nikula wrote: > Fix shellcheck SC2126: Consider using grep -c instead of grep|wc. > > Signed-off-by: Jani Nikula <jani.nikula@intel.com> > --- > Makefile | 1 - > dim | 2 +- > 2 files changed, 1 insertion(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index fe7e44ad69d9..78087f669221 100644 > --- a/Makefile > +++ b/Makefile > @@ -28,7 +28,6 @@ SC_EXCLUDE := \ > -e SC2090 \ > -e SC2119 \ > -e SC2120 \ > - -e SC2126 \ > -e SC2143 > > shellcheck: > diff --git a/dim b/dim > index 16e489c0b508..53221de9171c 100755 > --- a/dim > +++ b/dim > @@ -496,7 +496,7 @@ function dim_rebuild_tip > rerere=$DIM_PREFIX/drm-rerere > > cd $rerere > - if [[ $(git status --porcelain | grep -v "^[ ?][ ?]" | wc -l) -gt 0 ]]; then > + if [[ $(git status --porcelain | grep -c -v "^[ ?][ ?]") -gt 0 ]]; then grep -q and drop the -gt 0? > warn_or_fail "integration configuration file $integration_config not commited" > fi > > -- > 2.1.4 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff --git a/Makefile b/Makefile index fe7e44ad69d9..78087f669221 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,6 @@ SC_EXCLUDE := \ -e SC2090 \ -e SC2119 \ -e SC2120 \ - -e SC2126 \ -e SC2143 shellcheck: diff --git a/dim b/dim index 16e489c0b508..53221de9171c 100755 --- a/dim +++ b/dim @@ -496,7 +496,7 @@ function dim_rebuild_tip rerere=$DIM_PREFIX/drm-rerere cd $rerere - if [[ $(git status --porcelain | grep -v "^[ ?][ ?]" | wc -l) -gt 0 ]]; then + if [[ $(git status --porcelain | grep -c -v "^[ ?][ ?]") -gt 0 ]]; then warn_or_fail "integration configuration file $integration_config not commited" fi
Fix shellcheck SC2126: Consider using grep -c instead of grep|wc. Signed-off-by: Jani Nikula <jani.nikula@intel.com> --- Makefile | 1 - dim | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)