MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getArgValue

Function getArgValue

packages/payments/scripts/sync-subscriptions.ts:28–41  ·  view source on GitHub ↗
(flag: string)

Source from the content-addressed store, hash-verified

26const targetSubscriptionId = getArgValue('--subscription-id');
27
28function getArgValue(flag: string) {
29 const directPrefix = `${flag}=`;
30 const direct = process.argv.find((arg) => arg.startsWith(directPrefix));
31 if (direct) {
32 return direct.slice(directPrefix.length);
33 }
34
35 const index = process.argv.indexOf(flag);
36 if (index === -1) {
37 return undefined;
38 }
39
40 return process.argv[index + 1];
41}
42
43function getServer() {
44 if (process.env.POLAR_SERVER) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected