MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / loadConfig

Function loadConfig

scripts/studio-host-provider.mjs:630–650  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

628}
629
630async function loadConfig(args) {
631 const configPath = args["config"] || defaultConfigPath;
632 let config = {};
633 try {
634 config = JSON.parse(await fs.promises.readFile(configPath, "utf8"));
635 } catch {
636 config = {};
637 }
638 config.studioUrl = (args["studio-url"] || config.studioUrl || "").replace(
639 /\/$/,
640 "",
641 );
642 config.hostId = args["host-id"] || config.hostId || "";
643 config.hostToken = args["host-token"] || config.hostToken || "";
644 if (!config.studioUrl || !config.hostId || !config.hostToken) {
645 throw new Error(
646 "Missing provider config. Run `simdeck provider connect --studio-url ... --host-id ... --host-token ...` first.",
647 );
648 }
649 return config;
650}
651
652function simdeckBinary() {
653 if (process.env.SIMDECK_BINARY) {

Callers 2

statusFunction · 0.85
runFunction · 0.85

Calls 2

replaceMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected