1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
tdzl2003 2016-04-03 15:09:21 +08:00
parent d0037f1217
commit c2c3760fb5
4 changed files with 69 additions and 1 deletions

View File

@ -35,7 +35,25 @@
},
"uploadIpa": {
},
"uploadApk": {
},
"publish": {
"options": {
"platform": {
"hasValue": true
},
"name": {
"hasValue": true
},
"description": {
"hasValue": true
},
"metaInfo": {
"hasValue": true
}
}
},
"build": {

View File

@ -18,6 +18,7 @@ const commands = {
...require('./bundle').commands,
...require('./app').commands,
...require('./package').commands,
...require('./versions').commands,
help: printUsage,
};

View File

@ -27,5 +27,22 @@ export const commands = {
name,
hash,
});
console.log('Ok.');
},
uploadApk: async function({args}) {
const fn = args[0];
if (!fn) {
throw new Error('Usage: pushy uploadApk <ipaFile>');
}
const name = await getApkVersion(fn);
const {appId} = await getSelectedApp('android');
const {hash} = await uploadFile(fn);
await post(`/app/${appId}/package/create`, {
name,
hash,
});
console.log('Ok.');
},
};

32
local-cli/src/versions.js Normal file
View File

@ -0,0 +1,32 @@
/**
* Created by tdzl2003 on 4/2/16.
*/
const {
get,
post,
uploadFile,
} = require('./api');
import { checkPlatform, getSelectedApp } from './app';
export const commands = {
publish: async function({args, options}) {
const fn = args[0];
const {platform, name, description, metaInfo } = options;
if (!fn || !platform) {
throw new Error('Usage: pushy publish <ppkFile> --platform ios|android');
}
const {appId} = await getSelectedApp(platform);
const {hash} = await uploadFile(fn);
const {id} = await post(`/app/${appId}/version/create`, {
name,
hash,
description,
metaInfo,
});
console.log('Ok.');
},
};