MCPcopy Index your code
hub / github.com/callstack/agent-device / resolveDeployTarget

Function resolveDeployTarget

src/daemon/handlers/session-deploy.ts:209–236  ·  view source on GitHub ↗
(
  command: 'install' | 'reinstall',
  positionals: string[],
)

Source from the content-addressed store, hash-verified

207}
208
209function resolveDeployTarget(
210 command: 'install' | 'reinstall',
211 positionals: string[],
212): { ok: true; app: string; appPathInput: string } | { ok: false; response: DaemonResponse } {
213 const first = positionals[0]?.trim();
214 const second = positionals[1]?.trim();
215 if (command === 'install') {
216 const appPathInput = second ?? first;
217 if (!appPathInput) {
218 return {
219 ok: false,
220 response: errorResponse('INVALID_ARGS', 'install requires: install <path-to-app-binary>'),
221 };
222 }
223 return { ok: true, app: second ? (first ?? '') : '', appPathInput };
224 }
225
226 if (!first || !second) {
227 return {
228 ok: false,
229 response: errorResponse(
230 'INVALID_ARGS',
231 'reinstall requires: reinstall <app> <path-to-app-binary>',
232 ),
233 };
234 }
235 return { ok: true, app: first, appPathInput: second };
236}

Callers 1

handleAppDeployCommandFunction · 0.85

Calls 1

errorResponseFunction · 0.90

Tested by

no test coverage detected