This repository was archived by the owner on May 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
cloudbase/functions/usage Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const { handleCompletion } = require('../lib/completion')
1717
1818let processArgv = process . argv
1919const isBeta = pkg . version . indexOf ( '-' ) > - 1
20+ process . CLI_VERSION = pkg . version
2021
2122const [ major , minor ] = process . versions . node . split ( '.' ) . slice ( 0 , 2 )
2223
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ class DataSchema {
1111 this . macMd5 = data . macMd5 || ''
1212 this . uin = data . uin || ''
1313 this . os = data . os || ''
14+ this . version = data . version || ''
1415 this . date = new Date ( )
1516 }
1617}
Original file line number Diff line number Diff line change @@ -19,10 +19,11 @@ function collectUsage(command) {
1919 const macMd5 = yield platform_1 . getMacAddressMd5 ( ) ;
2020 const os = yield platform_1 . getOSInfo ( ) ;
2121 const data = {
22- command,
23- macMd5,
22+ os,
2423 uin,
25- os
24+ macMd5,
25+ command,
26+ version : process . CLI_VERSION
2627 } ;
2728 return http_request_1 . postFetch ( url , data ) ;
2829 } ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ declare global {
55 namespace NodeJS {
66 interface Process {
77 IS_DEBUG : boolean
8+ CLI_VERSION : string
89 }
910 }
1011}
Original file line number Diff line number Diff line change @@ -9,10 +9,11 @@ export async function collectUsage(command: string) {
99 const macMd5 = await getMacAddressMd5 ( )
1010 const os = await getOSInfo ( )
1111 const data = {
12- command,
13- macMd5,
12+ os,
1413 uin,
15- os
14+ macMd5,
15+ command,
16+ version : process . CLI_VERSION
1617 }
1718
1819 return postFetch ( url , data )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ declare global {
33 namespace NodeJS {
44 interface Process {
55 IS_DEBUG : boolean ;
6+ CLI_VERSION : string ;
67 }
78 }
89}
You can’t perform that action at this time.
0 commit comments