We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 98b687a commit f99f6e9Copy full SHA for f99f6e9
pre-commit.sh
@@ -33,8 +33,16 @@ if [ ! -d $pcommit_cache ]; then
33
mkdir -p $pcommit_cache;
34
fi
35
36
+### Helper functions
37
+function has() {
38
+ curl -sL https://git.io/_has | bash -s $1 > /dev/null
39
+ return $?
40
+}
41
+
42
# Execute container image
-podman run --name ${container_name} -ti \
43
+has "podman" && command="podman" || has "docker" && command="docker"
44
45
+$command run --name ${container_name} -ti \
46
-v ${book}:${container_book}:z \
47
-v ${ssh_cfg_cpy}:${container_ssh_cfg}:z,ro \
48
-v ${pcommit_cache}:${container_pcommit_cache}:z \
@@ -43,6 +51,6 @@ exitcode=$?
51
52
# Cleanup
53
rm -rf ${ssh_cfg_cpy}
-podman rm -f ${container_name} > /dev/null
54
+$command rm -f ${container_name} > /dev/null
55
56
exit $exitcode
0 commit comments