mirror of
https://github.com/msojocs/wechat-web-devtools-linux.git
synced 2025-07-07 00:02:14 +08:00
31 lines
1.0 KiB
Bash
Executable File
31 lines
1.0 KiB
Bash
Executable File
#!/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]}
|
|
|
|
LATEST_TAG=$(git describe --abbrev=0)
|
|
|
|
# 检查snapcraft主版本号是否正确
|
|
SNAP_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "'\d+\.\d+\.\d+-\d+" -o)
|
|
if [ "v${SNAP_VERSION//\'/}" != "$LATEST_TAG" ];then
|
|
echo "SNAP版本不正确!!!"
|
|
echo "SNAP版本: v${SNAP_VERSION//\'/} != 最新TAG: $LATEST_TAG"
|
|
exit 1
|
|
fi
|
|
|
|
# 检查snapcraft构建时下载的工具版本号是否正确
|
|
SNAP_DEVTOOL_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "=\d+\d+\d{5,}" -o)
|
|
if [ "${SNAP_DEVTOOL_VERSION//=/}" != "${TARGET_VERSION//./}" ];then
|
|
echo "SNAP工具版本不匹配!!!"
|
|
echo "snap下载版本: ${SNAP_DEVTOOL_VERSION//=/} != 目标版本: ${TARGET_VERSION//./}"
|
|
exit 1
|
|
fi
|