MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / isPaidVersion

Function isPaidVersion

utils/setup.js:18–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16const ADMOB_PLUGIN_DIR = "admob";
17
18function isPaidVersion() {
19 const configPath = path.join(__dirname, "../config.xml");
20 let config;
21
22 try {
23 config = fs.readFileSync(configPath, "utf8");
24 } catch (error) {
25 throw new Error(`Unable to read config.xml at ${configPath}.`, {
26 cause: error,
27 });
28 }
29
30 const widgetId = /<widget[^>]*?\sid=["']([^"']+)["']/.exec(config)?.[1];
31
32 return widgetId === ID_PAID;
33}
34
35function getPackageManager() {
36 const userAgent = process.env.npm_config_user_agent;

Callers 1

setup.jsFile · 0.85

Calls 1

execMethod · 0.65

Tested by

no test coverage detected