mirror of
https://gitcode.com/github-mirrors/react-native-update-cli.git
synced 2025-09-16 09:41:38 +08:00
support harmony
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-update-cli",
|
||||
"version": "1.36.0",
|
||||
"version": "1.37.0",
|
||||
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
@@ -23,6 +23,7 @@
|
||||
"react-native",
|
||||
"ios",
|
||||
"android",
|
||||
"harmony",
|
||||
"update"
|
||||
],
|
||||
"author": "reactnativecn",
|
||||
|
@@ -7,6 +7,7 @@ import { post, get, doDelete } from './api';
|
||||
const validPlatforms = {
|
||||
ios: 1,
|
||||
android: 1,
|
||||
harmony: 1,
|
||||
};
|
||||
|
||||
export function checkPlatform(platform) {
|
||||
@@ -74,7 +75,7 @@ export const commands = {
|
||||
const name = options.name || (await question('应用名称:'));
|
||||
const { downloadUrl } = options;
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
const { id } = await post('/app/create', { name, platform });
|
||||
console.log(`已成功创建应用(id: ${id})`);
|
||||
@@ -98,7 +99,7 @@ export const commands = {
|
||||
},
|
||||
selectApp: async function ({ args, options }) {
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
const id = args[0] ? parseInt(args[0]) : (await chooseApp(platform)).id;
|
||||
|
||||
|
@@ -699,7 +699,7 @@ function diffArgsCheck(args, options, diffFn) {
|
||||
export const commands = {
|
||||
bundle: async function ({ options }) {
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
|
||||
let { bundleName, entryFile, intermediaDir, output, dev, sourcemap } =
|
||||
|
@@ -138,7 +138,7 @@ export const commands = {
|
||||
},
|
||||
packages: async function ({ options }) {
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
const { appId } = await getSelectedApp(platform);
|
||||
await listPackage(appId);
|
||||
|
@@ -86,12 +86,12 @@ export const commands = {
|
||||
|
||||
if (!fn || !fn.endsWith('.ppk')) {
|
||||
throw new Error(
|
||||
'使用方法: pushy publish ppk后缀文件 --platform ios|android',
|
||||
'使用方法: pushy publish ppk后缀文件 --platform ios|android|harmony',
|
||||
);
|
||||
}
|
||||
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
const { appId } = await getSelectedApp(platform);
|
||||
|
||||
@@ -114,14 +114,14 @@ export const commands = {
|
||||
},
|
||||
versions: async function ({ options }) {
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
const { appId } = await getSelectedApp(platform);
|
||||
await listVersions(appId);
|
||||
},
|
||||
update: async function ({ args, options }) {
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
const { appId } = await getSelectedApp(platform);
|
||||
let versionId = options.versionId || (await chooseVersion(appId)).id;
|
||||
@@ -255,7 +255,7 @@ export const commands = {
|
||||
},
|
||||
updateVersionInfo: async function ({ args, options }) {
|
||||
const platform = checkPlatform(
|
||||
options.platform || (await question('平台(ios/android):')),
|
||||
options.platform || (await question('平台(ios/android/harmony):')),
|
||||
);
|
||||
const { appId } = await getSelectedApp(platform);
|
||||
const versionId = options.versionId || (await chooseVersion(appId)).id;
|
||||
|
Reference in New Issue
Block a user