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

Function openTarget

src/platforms/linux/tool-provider.ts:131–150  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

129): LinuxDesktopProvider {
130 return {
131 async openTarget(target) {
132 if (target.includes('://') || target.startsWith('/')) {
133 await runCommand('xdg-open', [target]);
134 return;
135 }
136
137 if (await whichCommand(target)) {
138 runCommand(target, [], { allowFailure: true }).catch((err) => {
139 emitDiagnostic({
140 level: 'warn',
141 phase: 'linux_app_launch',
142 data: { app: target, error: String(err) },
143 });
144 });
145 await sleep(500);
146 return;
147 }
148
149 await runCommand('xdg-open', [target], { allowFailure: true });
150 },
151 async closeApp(app) {
152 if (await whichCommand('wmctrl')) {
153 await runCommand('wmctrl', ['-c', app], { allowFailure: true });

Callers

nothing calls this directly

Calls 4

emitDiagnosticFunction · 0.90
sleepFunction · 0.90
startsWithMethod · 0.80
runCommandFunction · 0.50

Tested by

no test coverage detected