Skip to content

Commit 8c02f7a

Browse files
committed
feat: 项目加入hook
update: snap版本号跟进
1 parent 943bb80 commit 8c02f7a

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

.husky/pre-commit

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
# 检验版本号是否匹配
5+
6+
root_dir=$(cd `dirname $0`/.. && pwd -P)
7+
8+
# 获取开发工具版本号与MD5
9+
VERSION_DATA=$( cat "$root_dir/conf/devtools_v" )
10+
VERSION_DATA=(${VERSION_DATA//,/ })
11+
TARGET_VERSION=${VERSION_DATA[0]}
12+
TARGET_VERSION_MD5=${VERSION_DATA[1]}
13+
14+
# 获取snapcraft中的版本号
15+
SNAP_VERSION=$(find $root_dir/snap -name "snapcraft.yaml" | xargs grep -P "'\d+\.\d+\.\d{5,}" -o)
16+
17+
if [ "$SNAP_VERSION" != "'$TARGET_VERSION" ];then
18+
echo "SNAP版本不匹配!!!"
19+
exit 1
20+
fi

package-lock.json

Lines changed: 28 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
{}
1+
{
2+
"scripts": {
3+
"prepare": "husky install"
4+
},
5+
"devDependencies": {
6+
"husky": "^7.0.4"
7+
}
8+
}

snap/snapcraft.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: wechat-devtools # you probably want to 'snapcraft register <name>'
22
base: core18 # the base snap is the execution environment for this snap
3-
version: '1.05.2203070-9' # just for humans, typically '1.2+git' or '1.3.2'
3+
version: '1.05.2204180-1' # just for humans, typically '1.2+git' or '1.3.2'
44
summary: WeChat Devtools for Linux # 79 char long summary
55
description: |
66
WeChat Devtools for Linux.

0 commit comments

Comments
 (0)