github.com/cloudwego/hertz@v0.9.3/script/pre-commit-hook (about)

     1  #!/bin/bash
     2  main() {
     3    file_name=.git/hooks/pre-commit
     4  
     5    cat <<EOF >$file_name
     6  #!/bin/bash
     7  # version=11
     8  
     9  main() {
    10        echo "Start to format code..."
    11        bash script/go-fmt
    12        echo -e "\033[32m Complete code style formatting :) \033[0m"
    13  }
    14  
    15  main
    16  EOF
    17  
    18    chmod +x $file_name
    19  }
    20  
    21  main