UNPKG

sanity

Version:

Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches

31 lines (30 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }); var cli = require("@sanity/cli"); const envPrefix = "SANITY_STUDIO_"; function getStudioEnvironmentVariables(options = {}) { const { prefix = "", envFile = !1, jsonEncode = !1 } = options, fullEnv = envFile ? { ...process.env, ...cli.loadEnv(envFile.mode, envFile.envDir || process.cwd(), [envPrefix]) } : process.env, studioEnv = {}; for (const key in fullEnv) key.startsWith(envPrefix) && (studioEnv[`${prefix}${key}`] = jsonEncode ? JSON.stringify(fullEnv[key] || "") : fullEnv[key] || ""); return studioEnv; } Object.defineProperty(exports, "createCliConfig", { enumerable: !0, get: function() { return cli.createCliConfig; } }); Object.defineProperty(exports, "defineCliConfig", { enumerable: !0, get: function() { return cli.defineCliConfig; } }); Object.defineProperty(exports, "getCliClient", { enumerable: !0, get: function() { return cli.getCliClient; } }); exports.getStudioEnvironmentVariables = getStudioEnvironmentVariables; //# sourceMappingURL=cli.js.map