MCPcopy Create free account
hub / github.com/appium/appium / _patchExit

Method _patchExit

packages/appium/lib/cli/parser.ts:149–156  ·  view source on GitHub ↗

* Patches the `exit()` method of the parser to throw an error, so we can handle it manually.

(parser: ArgumentParser)

Source from the content-addressed store, hash-verified

147 * Patches the `exit()` method of the parser to throw an error, so we can handle it manually.
148 */
149 private static _patchExit(parser: ArgumentParser): void {
150 parser.exit = (code, msg) => {
151 if (code) {
152 throw new Error(msg);
153 }
154 process.exit();
155 };
156 }
157
158 /**
159 * Adds the `server` subcommand parser and returns its argument definitions.

Callers 4

constructorMethod · 0.80
_addServerToParserMethod · 0.80
_addSetupToParserMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected