MCPcopy Create free account
hub / github.com/Snapchat/Valdi / valdiInstall

Function valdiInstall

npm_modules/cli/src/commands/install.ts:17–67  ·  view source on GitHub ↗
(argv: ArgumentsResolver<CommandParameters>)

Source from the content-addressed store, hash-verified

15
16
17async function valdiInstall(argv: ArgumentsResolver<CommandParameters>) {
18 const bazel = new BazelClient();
19
20 const buildInfo = await getBuildInfo(argv, bazel, true);
21
22 // Output Selection
23 // ----------------
24
25 // Perform build and install
26 // -------------------------
27 console.log(`Building: ${wrapInColor(buildInfo.application, ANSI_COLORS.GREEN_COLOR)}`);
28
29 switch (buildInfo.platform) {
30 case PLATFORM.ANDROID: {
31 const outputFilePath = await argv.getArgumentOrResolve('target_output_path', () => {
32 console.log('Resolving output paths...');
33 return getOutputFilePath(bazel, applicationExtensionForPlatform(buildInfo.platform), buildInfo.application, buildInfo.bazelArgs);
34 });
35 await bazel.buildTarget(buildInfo.application, buildInfo.bazelArgs);
36
37 console.log('Installing Android application...');
38 await installAndroidApk(outputFilePath, buildInfo.selectedDevice);
39 logReproduceThisCommandIfNeeded(argv);
40 break;
41 }
42 case PLATFORM.IOS: {
43 console.log('Installing iOS application...');
44 await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs);
45 logReproduceThisCommandIfNeeded(argv);
46 break;
47 }
48 case PLATFORM.MACOS: {
49 logReproduceThisCommandIfNeeded(argv);
50 console.log('Installing MacOS application...');
51 await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs);
52 break;
53 }
54 case PLATFORM.LINUX: {
55 logReproduceThisCommandIfNeeded(argv);
56 console.log('Running Linux application...');
57 await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs);
58 break;
59 }
60 case PLATFORM.CLI: {
61 logReproduceThisCommandIfNeeded(argv);
62 console.log('Running CLI application...');
63 await bazel.runTarget(buildInfo.application, buildInfo.bazelArgs);
64 break;
65 }
66 }
67}
68
69export const command = 'install <platform>';
70export const describe = 'Build and install the application to the connected device';

Callers

nothing calls this directly

Calls 10

buildTargetMethod · 0.95
runTargetMethod · 0.95
getBuildInfoFunction · 0.90
wrapInColorFunction · 0.90
getOutputFilePathFunction · 0.90
installAndroidApkFunction · 0.90
getArgumentOrResolveMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected