From 35584efa90719d7fabb865385aa4dc3b75db5b6e Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 18 Jun 2015 11:07:05 +0200 Subject: [PATCH] dib-lint: make it work on Mac OS X Pass an explicit template to mktemp since that is required on Mac OS X. Hardcoded to /tmp since I did not want to bother validating TMPDIR which is user supplied. Explicit define a repeating group which causes a grep error: repetition-operator operand invalid Change-Id: Ib23cc15db7f7dfdd611280884e46342562d545df --- bin/dib-lint | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/dib-lint b/bin/dib-lint index 9e6c3748..31cbd4d8 100755 --- a/bin/dib-lint +++ b/bin/dib-lint @@ -59,7 +59,7 @@ error() { } rc=0 -TMPDIR=$(mktemp -d) +TMPDIR=$(mktemp -d /tmp/tmp.XXXXXXXXXX) trap "rm -rf $TMPDIR" EXIT for i in $(find elements -type f \ -not -name \*~ \ @@ -80,7 +80,7 @@ for i in $(find elements -type f \ flake8 $i else if ! excluded indent ; then - if grep -q "^ \{4\}* \{1,3\}[^ ]" ${i}; then + if grep -q "^\( \{4\}\)* \{1,3\}[^ ]" ${i}; then error "$i should use 4 spaces indent" fi fi