From: Oleg Broytman Date: Tue, 23 Jan 2024 08:36:43 +0000 (+0300) Subject: Simplify regular expressions for `compileall` X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=commitdiff_plain;h=a714b68774b0ab9ca79442740bdd4636a41cdd1f Simplify regular expressions for `compileall` --- diff --git a/add-pubkey/post-checkout b/add-pubkey/post-checkout index 19ac074..5017228 100755 --- a/add-pubkey/post-checkout +++ b/add-pubkey/post-checkout @@ -11,8 +11,8 @@ if [ \( "$new_branch" = 1 \) ]; then if [ "$new_HEAD" = "`git rev-parse phd-pubkey`" ]; then git clean -d -f -q else - python -m compileall -q -x '\.tox/.+' . && - python -O -m compileall -q -x '\.tox/.+' . + python -m compileall -q -x '\.tox/' . && + python -O -m compileall -q -x '\.tox/' . fi fi diff --git a/hooks/post-checkout/compyle b/hooks/post-checkout/compyle index 0952d43..c781913 100755 --- a/hooks/post-checkout/compyle +++ b/hooks/post-checkout/compyle @@ -8,8 +8,8 @@ new_HEAD="$2" new_branch="$3" if [ "$new_branch" = 1 ]; then - python -m compileall -q -x '\.tox/.+' . && - python -O -m compileall -q -x '\.tox/.+' . + python -m compileall -q -x '\.tox/' . && + python -O -m compileall -q -x '\.tox/' . fi exit 0 diff --git a/hooks/post-checkout/compyle-all b/hooks/post-checkout/compyle-all index d4887f6..3cdae19 100755 --- a/hooks/post-checkout/compyle-all +++ b/hooks/post-checkout/compyle-all @@ -2,7 +2,7 @@ # post-checkout hook that compiles python files to byte code -python -m compileall -q -x '\.tox/.+' . && -python -O -m compileall -q -x '\.tox/.+' . +python -m compileall -q -x '\.tox/' . && +python -O -m compileall -q -x '\.tox/' . exit 0 diff --git a/hooks/post-merge b/hooks/post-merge index 633a1d0..2df0670 100755 --- a/hooks/post-merge +++ b/hooks/post-merge @@ -2,7 +2,7 @@ # post-merge hook that compiles python files to byte code -python -m compileall -q -x '\.tox/.+' . && -python -O -m compileall -q -x '\.tox/.+' . +python -m compileall -q -x '\.tox/' . && +python -O -m compileall -q -x '\.tox/' . exit 0 diff --git a/hooks/post-rewrite b/hooks/post-rewrite index df28442..59efb3d 100755 --- a/hooks/post-rewrite +++ b/hooks/post-rewrite @@ -2,7 +2,7 @@ # post-rewrite hook that compiles python files to byte code -python -m compileall -q -x '\.tox/.+' . && -python -O -m compileall -q -x '\.tox/.+' . +python -m compileall -q -x '\.tox/' . && +python -O -m compileall -q -x '\.tox/' . exit 0