From 8c02f7a13cdd4e97458db845e44615d3fdaad1c9 Mon Sep 17 00:00:00 2001 From: msojocs Date: Mon, 25 Apr 2022 11:35:58 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=A1=B9=E7=9B=AE=E5=8A=A0=E5=85=A5hoo?= =?UTF-8?q?k=20update:=20snap=E7=89=88=E6=9C=AC=E5=8F=B7=E8=B7=9F=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .husky/pre-commit | 20 ++++++++++++++++++++ package-lock.json | 30 ++++++++++++++++++++++++++++-- package.json | 9 ++++++++- snap/snapcraft.yaml | 2 +- 4 files changed, 57 insertions(+), 4 deletions(-) create mode 100755 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..6a35ec2 --- /dev/null +++ b/.husky/pre-commit @@ -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 diff --git a/package-lock.json b/package-lock.json index 921fbb1..6f5ea6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,32 @@ { - "name": "wechat-devtools", + "name": "wechat-web-devtools-linux", "lockfileVersion": 2, "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 + } + } } diff --git a/package.json b/package.json index 0967ef4..565c993 100644 --- a/package.json +++ b/package.json @@ -1 +1,8 @@ -{} +{ + "scripts": { + "prepare": "husky install" + }, + "devDependencies": { + "husky": "^7.0.4" + } +} diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 2c747cb..e3e0022 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,6 +1,6 @@ name: wechat-devtools # you probably want to 'snapcraft register ' 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 description: | WeChat Devtools for Linux.