This is an automated email from the ASF dual-hosted git repository. kumfo pushed a commit to branch test in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
commit 4b3e0eaa4e407842d62ec19b4313942b53d3809e Author: Sonui <[email protected]> AuthorDate: Wed Aug 14 00:21:55 2024 +0800 perf: update check-asf-header.sh script to support Podman --- script/check-asf-header.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/script/check-asf-header.sh b/script/check-asf-header.sh index ff765eab..808efa10 100755 --- a/script/check-asf-header.sh +++ b/script/check-asf-header.sh @@ -16,5 +16,16 @@ # specific language governing permissions and limitations # under the License. -docker run -it --rm -v $(pwd):/github/workspace ghcr.io/korandoru/hawkeye-native format +# check if docker or podman is installed +if command -v docker >/dev/null 2>&1; then + CONTAINER_RUNTIME="docker" +elif command -v podman >/dev/null 2>&1; then + CONTAINER_RUNTIME="podman" +else + echo "Neither Docker nor Podman is installed. Please install either Docker or Podman." + exit 1 +fi + +$CONTAINER_RUNTIME run -it --rm -v "$(pwd)":/github/workspace ghcr.io/korandoru/hawkeye-native format + gofmt -w -l .
