Files
.dotfile/git/gittemplates/hooks/pre_commit.d/gomodreplase
T
2020-07-10 18:55:14 +08:00

9 lines
180 B
Bash

#!/bin/bash
# 检查是否有 go mod 替换了本地文件
res=$(grep '/Users/' ./go.mod)
if [ "x$res" != "x" ]; then
echo "use local file replace"
echo $res
exit 1
fi
exit 0