-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathcommand.ts
More file actions
29 lines (28 loc) · 954 Bytes
/
command.ts
File metadata and controls
29 lines (28 loc) · 954 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import type { AndroidProjectConfig } from '@react-native-community/cli-types';
import type { PluginApi } from '@rnef/config';
import { getValidProjectConfig } from '../getValidProjectConfig.js';
import type { Flags } from './runAndroid.js';
import { runAndroid, runOptions } from './runAndroid.js';
export function registerRunCommand(
api: PluginApi,
pluginConfig: AndroidProjectConfig | undefined,
commandName: string
) {
api.registerCommand({
name: commandName,
description:
'Builds your app and starts it on a connected Android emulator or a device.',
action: async (args) => {
const projectRoot = api.getProjectRoot();
const androidConfig = getValidProjectConfig(projectRoot, pluginConfig);
await runAndroid(
androidConfig,
args as Flags,
projectRoot,
await api.getRemoteCacheProvider(),
api.getFingerprintOptions()
);
},
options: runOptions,
});
}