32 lines
604 B
JavaScript
32 lines
604 B
JavaScript
|
/**
|
||
|
* Created by tdzl2003 on 4/2/16.
|
||
|
*/
|
||
|
|
||
|
const {
|
||
|
get,
|
||
|
post,
|
||
|
uploadFile,
|
||
|
} = require('./api');
|
||
|
|
||
|
import { checkPlatform, getSelectedApp } from './app';
|
||
|
|
||
|
import {getIPAVersion, getApkVersion} from './utils';
|
||
|
|
||
|
export const commands = {
|
||
|
uploadIpa: async function({args}) {
|
||
|
const fn = args[0];
|
||
|
if (!fn) {
|
||
|
throw new Error('Usage: pushy uploadIpa <ipaFile>');
|
||
|
}
|
||
|
const name = await getIPAVersion(fn);
|
||
|
const {appId} = await getSelectedApp('ios');
|
||
|
|
||
|
const {hash} = await uploadFile(fn);
|
||
|
|
||
|
await post(`/app/${appId}/package/create`, {
|
||
|
name,
|
||
|
hash,
|
||
|
});
|
||
|
}
|
||
|
};
|