File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,21 @@ precommit-check:
3131# bash
3232# and then, run `pre-commit install && pre-commit run --all-files` command
3333precommit-local :
34- @if ! docker image inspect ${PRECOMMIT_CONTAINER} > /dev/null 2>&1 ; then \
34+ @if command -v docker > /dev/null 2>&1 ; then \
35+ CONTAINER_CMD=docker; \
36+ elif command -v podman > /dev/null 2>&1 ; then \
37+ CONTAINER_CMD=podman; \
38+ else \
39+ echo " Error: Neither docker nor podman is installed. Please install one of them." ; \
40+ exit 1; \
41+ fi ; \
42+ if ! $$ CONTAINER_CMD image inspect ${PRECOMMIT_CONTAINER} > /dev/null 2>&1 ; then \
3543 echo " Image not found locally. Pulling..." ; \
36- docker pull ${PRECOMMIT_CONTAINER} ; \
44+ $$ CONTAINER_CMD pull ${PRECOMMIT_CONTAINER} ; \
3745 else \
3846 echo " Image found locally. Skipping pull." ; \
39- fi
40- docker run --rm \
47+ fi ; \
48+ $$ CONTAINER_CMD run --rm \
4149 -v $(shell pwd) :/app \
4250 -w /app \
4351 --name precommit-container ${PRECOMMIT_CONTAINER} \
You can’t perform that action at this time.
0 commit comments