mirror of https://github.com/zulip/zulip.git
tools/check-all: Optimize computing the list of Python files.
For reasons I don't totally understand, the previous code took like 2 seconds to compute the list of Python files. (imported from commit 23668e7d79f1d69e1225389be7d8c8a3fbb6fad1)
This commit is contained in:
parent
a01d641b2a
commit
6f1f2a15a1
|
@ -14,11 +14,9 @@ fi
|
|||
|
||||
cd "$SCRIPT_DIR"/..;
|
||||
|
||||
PYTHON_FILES=""
|
||||
for file in $(git ls-files); do
|
||||
if ([ -f "$file" ] && (head -n1 "$file" | grep -q "^#!.*python" ||
|
||||
echo "$file" | grep -q [.]py$) && \
|
||||
echo "$file" | egrep -vq '^(confirmation/|humbug/test_settings\.py)'); then
|
||||
PYTHON_FILES=$(git ls-files | grep [.]py$ | egrep -v '^(confirmation/|humbug/test_settings\.py)')
|
||||
for file in $(git ls-files | grep -v [.][^/]*$ | egrep -v '^(confirmation/|humbug/test_settings\.py)'); do
|
||||
if [ -f "$file" ] && head -n1 "$file" | grep -q "^#!.*python"; then
|
||||
PYTHON_FILES="$PYTHON_FILES $file"
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Reference in New Issue