msojocs 8c02f7a13c feat: 项目加入hook
update: snap版本号跟进
2022-04-25 11:35:58 +08:00

21 lines
546 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
# 检验版本号是否匹配
root_dir=$(cd `dirname $0`/.. && pwd -P)
# 获取开发工具版本号与MD5
VERSION_DATA=$( cat "$root_dir/conf/devtools_v" )
VERSION_DATA=(${VERSION_DATA//,/ })
TARGET_VERSION=${VERSION_DATA[0]}
TARGET_VERSION_MD5=${VERSION_DATA[1]}
# 获取snapcraft中的版本号
SNAP_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "'\d+\.\d+\.\d{5,}" -o)
if [ "$SNAP_VERSION" != "'$TARGET_VERSION" ];then
echo "SNAP版本不匹配"
exit 1
fi