Skip to content

Commit 4f07841

Browse files
committed
fix expo cli
1 parent 2672520 commit 4f07841

File tree

5 files changed

+87
-73
lines changed

5 files changed

+87
-73
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-update-cli",
3-
"version": "1.38.1",
3+
"version": "1.38.2",
44
"description": "Command tools for javaScript updater with `pushy` service for react native apps.",
55
"main": "index.js",
66
"bin": {

src/app.js renamed to src/app.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ import fs from 'node:fs';
33
import Table from 'tty-table';
44

55
import { post, get, doDelete } from './api';
6+
import type { Platform } from './types';
67

78
const validPlatforms = {
89
ios: 1,
910
android: 1,
1011
harmony: 1,
1112
};
1213

13-
export function checkPlatform(platform) {
14+
export function checkPlatform(platform: Platform) {
1415
if (!validPlatforms[platform]) {
1516
throw new Error(`无法识别的平台 '${platform}'`);
1617
}
1718
return platform;
1819
}
1920

20-
export function getSelectedApp(platform) {
21+
export function getSelectedApp(platform: Platform) {
2122
checkPlatform(platform);
2223

2324
if (!fs.existsSync('update.json')) {
@@ -34,7 +35,7 @@ export function getSelectedApp(platform) {
3435
return updateInfo[platform];
3536
}
3637

37-
export async function listApp(platform) {
38+
export async function listApp(platform: Platform) {
3839
const { data } = await get('/app/list');
3940
const list = platform ? data.filter((v) => v.platform === platform) : data;
4041

@@ -58,12 +59,12 @@ export async function listApp(platform) {
5859
return list;
5960
}
6061

61-
export async function chooseApp(platform) {
62+
export async function chooseApp(platform: Platform) {
6263
const list = await listApp(platform);
6364

6465
while (true) {
6566
const id = await question('输入应用 id:');
66-
const app = list.find((v) => v.id === (id | 0));
67+
const app = list.find((v) => v.id === Number(id));
6768
if (app) {
6869
return app;
6970
}

0 commit comments

Comments
 (0)