@@ -6,6 +6,8 @@ import { checkPlatform, getSelectedApp } from './app';
66import { getApkInfo , getIpaInfo , getAppInfo } from './utils' ;
77import Table from 'tty-table' ;
88import { depVersions } from './utils/dep-versions' ;
9+ import { getCommitInfo } from './utils/git' ;
10+ import type { Platform } from 'types' ;
911
1012export async function listPackage ( appId : string ) {
1113 const { data } = await get ( `/app/${ appId } /package/list?limit=1000` ) ;
@@ -81,13 +83,14 @@ export const commands = {
8183 hash,
8284 buildTime,
8385 deps : depVersions ,
86+ commit : await getCommitInfo ( ) ,
8487 } ) ;
8588 saveToLocal ( fn , `${ appId } /package/${ id } .ipa` ) ;
8689 console . log (
8790 `已成功上传ipa原生包(id: ${ id } , version: ${ versionName } , buildTime: ${ buildTime } )` ,
8891 ) ;
8992 } ,
90- uploadApk : async ( { args } ) => {
93+ uploadApk : async ( { args } : { args : string [ ] } ) => {
9194 const fn = args [ 0 ] ;
9295 if ( ! fn || ! fn . endsWith ( '.apk' ) ) {
9396 throw new Error ( '使用方法: pushy uploadApk apk后缀文件' ) ;
@@ -119,13 +122,14 @@ export const commands = {
119122 hash,
120123 buildTime,
121124 deps : depVersions ,
125+ commit : await getCommitInfo ( ) ,
122126 } ) ;
123127 saveToLocal ( fn , `${ appId } /package/${ id } .apk` ) ;
124128 console . log (
125129 `已成功上传apk原生包(id: ${ id } , version: ${ versionName } , buildTime: ${ buildTime } )` ,
126130 ) ;
127131 } ,
128- uploadApp : async ( { args } ) => {
132+ uploadApp : async ( { args } : { args : string [ ] } ) => {
129133 const fn = args [ 0 ] ;
130134 if ( ! fn || ! fn . endsWith ( '.app' ) ) {
131135 throw new Error ( '使用方法: pushy uploadApp app后缀文件' ) ;
@@ -157,34 +161,35 @@ export const commands = {
157161 hash,
158162 buildTime,
159163 deps : depVersions ,
164+ commit : await getCommitInfo ( ) ,
160165 } ) ;
161166 saveToLocal ( fn , `${ appId } /package/${ id } .app` ) ;
162167 console . log (
163168 `已成功上传app原生包(id: ${ id } , version: ${ versionName } , buildTime: ${ buildTime } )` ,
164169 ) ;
165170 } ,
166- parseApp : async ( { args } ) => {
171+ parseApp : async ( { args } : { args : string [ ] } ) => {
167172 const fn = args [ 0 ] ;
168173 if ( ! fn || ! fn . endsWith ( '.app' ) ) {
169174 throw new Error ( '使用方法: pushy parseApp app后缀文件' ) ;
170175 }
171176 console . log ( await getAppInfo ( fn ) ) ;
172177 } ,
173- parseIpa : async ( { args } ) => {
178+ parseIpa : async ( { args } : { args : string [ ] } ) => {
174179 const fn = args [ 0 ] ;
175180 if ( ! fn || ! fn . endsWith ( '.ipa' ) ) {
176181 throw new Error ( '使用方法: pushy parseIpa ipa后缀文件' ) ;
177182 }
178183 console . log ( await getIpaInfo ( fn ) ) ;
179184 } ,
180- parseApk : async ( { args } ) => {
185+ parseApk : async ( { args } : { args : string [ ] } ) => {
181186 const fn = args [ 0 ] ;
182187 if ( ! fn || ! fn . endsWith ( '.apk' ) ) {
183188 throw new Error ( '使用方法: pushy parseApk apk后缀文件' ) ;
184189 }
185190 console . log ( await getApkInfo ( fn ) ) ;
186191 } ,
187- packages : async ( { options } ) => {
192+ packages : async ( { options } : { options : { platform : Platform } } ) => {
188193 const platform = checkPlatform (
189194 options . platform || ( await question ( '平台(ios/android/harmony):' ) ) ,
190195 ) ;
0 commit comments