feat: 项目加入hook

update: snap版本号跟进
This commit is contained in:
msojocs 2022-04-25 11:35:58 +08:00
parent 943bb8017f
commit 8c02f7a13c
4 changed files with 57 additions and 4 deletions

20
.husky/pre-commit Executable file
View File

@ -0,0 +1,20 @@
#!/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

30
package-lock.json generated
View File

@ -1,6 +1,32 @@
{ {
"name": "wechat-devtools", "name": "wechat-web-devtools-linux",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": {} "packages": {
"": {
"devDependencies": {
"husky": "^7.0.4"
}
},
"node_modules/husky": {
"version": "7.0.4",
"resolved": "https://registry.npmmirror.com/husky/-/husky-7.0.4.tgz",
"integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==",
"dev": true,
"bin": {
"husky": "lib/bin.js"
},
"engines": {
"node": ">=12"
}
}
},
"dependencies": {
"husky": {
"version": "7.0.4",
"resolved": "https://registry.npmmirror.com/husky/-/husky-7.0.4.tgz",
"integrity": "sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==",
"dev": true
}
}
} }

View File

@ -1 +1,8 @@
{} {
"scripts": {
"prepare": "husky install"
},
"devDependencies": {
"husky": "^7.0.4"
}
}

View File

@ -1,6 +1,6 @@
name: wechat-devtools # you probably want to 'snapcraft register <name>' name: wechat-devtools # you probably want to 'snapcraft register <name>'
base: core18 # the base snap is the execution environment for this snap base: core18 # the base snap is the execution environment for this snap
version: '1.05.2203070-9' # just for humans, typically '1.2+git' or '1.3.2' version: '1.05.2204180-1' # just for humans, typically '1.2+git' or '1.3.2'
summary: WeChat Devtools for Linux # 79 char long summary summary: WeChat Devtools for Linux # 79 char long summary
description: | description: |
WeChat Devtools for Linux. WeChat Devtools for Linux.