Skip to content

Commit 91a6029

Browse files
committed
Refactor command exports to use specific command groups for app, bundle, package, user, and version modules
1 parent 2cfe451 commit 91a6029

File tree

6 files changed

+15
-10
lines changed

6 files changed

+15
-10
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.46.0",
3+
"version": "1.46.1",
44
"description": "command line tool for react-native-update (remote updates for react native)",
55
"main": "index.js",
66
"bin": {

src/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export async function chooseApp(platform: Platform) {
6666
}
6767
}
6868

69-
export const commands = {
69+
export const appCommands = {
7070
createApp: async function ({
7171
options,
7272
}: {

src/bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ function diffArgsCheck(args: string[], options: any, diffFn: string) {
908908
};
909909
}
910910

911-
export const commands = {
911+
export const bundleCommands = {
912912
bundle: async ({ options }) => {
913913
const platform = await getPlatform(options.platform);
914914

src/index.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import { loadSession } from './api';
44
import { printVersionCommand } from './utils';
55
import { t } from './utils/i18n';
6+
import { bundleCommands } from './bundle';
7+
import { versionCommands } from './versions';
8+
import { userCommands } from './user';
9+
import { appCommands } from './app';
10+
import { packageCommands } from './package';
611

712
function printUsage() {
813
// const commandName = args[0];
@@ -15,11 +20,11 @@ function printUsage() {
1520
}
1621

1722
const commands = {
18-
...require('./user').commands,
19-
...require('./bundle').commands,
20-
...require('./app').commands,
21-
...require('./package').commands,
22-
...require('./versions').commands,
23+
...userCommands,
24+
...bundleCommands,
25+
...appCommands,
26+
...packageCommands,
27+
...versionCommands,
2328
help: printUsage,
2429
};
2530

src/package.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function choosePackage(appId: string) {
5252
}
5353
}
5454

55-
export const commands = {
55+
export const packageCommands = {
5656
uploadIpa: async ({ args }: { args: string[] }) => {
5757
const fn = args[0];
5858
if (!fn || !fn.endsWith('.ipa')) {

src/user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function md5(str: string) {
77
return crypto.createHash('md5').update(str).digest('hex');
88
}
99

10-
export const commands = {
10+
export const userCommands = {
1111
login: async ({ args }: { args: string[] }) => {
1212
const email = args[0] || (await question('email:'));
1313
const pwd = args[1] || (await question('password:', true));

0 commit comments

Comments
 (0)