diff --git a/src/cli/index.ts b/src/cli/index.ts index 9c03761..200d49c 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -20,7 +20,8 @@ const argv = yargs }) .option('apk', { alias: 'a', - describe: 'Path to the APK file' + describe: 'Path to the APK file', + type: 'array' }) .config( 'key', diff --git a/src/helpers.ts b/src/helpers.ts index 159632e..b229782 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -14,9 +14,12 @@ export interface IPackageManifest { * Parse the manifest of an APK file * @param apk Path to the APK file */ -export const parseManifest = async (apk: string): Promise => { +export const parseManifest = async ( + apk: string | string[] +): Promise => { debug('> Parsing manifest') - const reader = await ApkReader.open(apk) + const apkFile = typeof apk !== 'string' ? apk[0] : apk + const reader = await ApkReader.open(apkFile) const manifest = await reader.readManifest() debug(`> Detected package name ${manifest.package}`) diff --git a/src/index.ts b/src/index.ts index 0db5308..83a7f0e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -64,7 +64,7 @@ export class Apkup { * ``` */ public async upload ( - apk: string, + apk: string | string[], uploadParams?: IUploadParams ): Promise { const apkPackage = await parseManifest(apk) @@ -108,7 +108,7 @@ export class Apkup { */ public async promote ( promoteParams: IPromoteParams, - apk?: string, + apk?: string | string[], editParams?: IEditParams ) { let edit: IEditParams