File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -6,3 +6,4 @@ packages/**/.nyc_output/
6
6
7
7
scripts /reports
8
8
scripts /allure-report
9
+ package-info.json
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ # sh scripts/update-core-version.sh
4
+
5
+ # 將 npm info 輸出到 JSON 文件
6
+ npm info @coolwallet/core --json > package-info.json
7
+
8
+ time_data=$( grep -o ' "1\.[0-9]\+\.[0-9]\+[^"]*": "[^"]*"' package-info.json)
9
+
10
+ # 確認 time_data 是否有內容
11
+ if [ -z " $time_data " ]; then
12
+ echo " No versions found in time_data."
13
+ exit 1
14
+ fi
15
+
16
+ echo " Time data:"
17
+ echo " $time_data "
18
+
19
+ # 提取所有版本和時間,並按時間排序,取出最新的版本
20
+ latest_version=$( echo " $time_data " | grep -o ' "1\.[0-9]\+\.[0-9][^"]*": "[^"]*"' | sort -t ' "' -k 4,4r | head -n 1)
21
+ echo " latest_version: $latest_version "
22
+
23
+ # 輸出最新版本
24
+ if [ -n " $latest_version " ]; then
25
+ final_version=$( echo " $latest_version " | sed ' s/":.*//;s/"//g' )
26
+ echo " Latest version: $final_version "
27
+ else
28
+ echo " No version found."
29
+ fi
30
+
31
+ # 組出要執行的 command
32
+ command=" npm install @coolwallet/core@$final_version --save-peer"
33
+ echo " command: $command "
34
+
35
+ IGNORE_SCOPES=(
36
+ --ignore @coolwallet/core
37
+ --ignore @coolwallet/transport-react-native-ble
38
+ --ignore tester
39
+ --ignore @coolwallet/testing-library
40
+ --ignore @coolwallet/template
41
+ )
42
+ # 執行 lerna command
43
+ npx lerna exec $IGNORE_SCOPES -- $command
You can’t perform that action at this time.
0 commit comments