working
This commit is contained in:
parent
d0037f1217
commit
c2c3760fb5
@ -35,7 +35,25 @@
|
||||
},
|
||||
|
||||
"uploadIpa": {
|
||||
},
|
||||
"uploadApk": {
|
||||
},
|
||||
|
||||
"publish": {
|
||||
"options": {
|
||||
"platform": {
|
||||
"hasValue": true
|
||||
},
|
||||
"name": {
|
||||
"hasValue": true
|
||||
},
|
||||
"description": {
|
||||
"hasValue": true
|
||||
},
|
||||
"metaInfo": {
|
||||
"hasValue": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
"build": {
|
||||
|
@ -18,6 +18,7 @@ const commands = {
|
||||
...require('./bundle').commands,
|
||||
...require('./app').commands,
|
||||
...require('./package').commands,
|
||||
...require('./versions').commands,
|
||||
help: printUsage,
|
||||
};
|
||||
|
||||
|
@ -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
32
local-cli/src/versions.js
Normal 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.');
|
||||
},
|
||||
};
|
Loading…
Reference in New Issue
Block a user