mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
19 lines
868 B
JavaScript
19 lines
868 B
JavaScript
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
var utils_1 = require("./utils");
|
||
|
var findGraphQLConfigFile_1 = require("./findGraphQLConfigFile");
|
||
|
var GraphQLConfig_1 = require("./GraphQLConfig");
|
||
|
function getGraphQLConfig(rootDir) {
|
||
|
if (rootDir === void 0) { rootDir = process.cwd(); }
|
||
|
var configPath = findGraphQLConfigFile_1.findGraphQLConfigFile(rootDir);
|
||
|
var config = utils_1.readConfig(configPath);
|
||
|
utils_1.validateConfig(config);
|
||
|
return new GraphQLConfig_1.GraphQLConfig(config, configPath);
|
||
|
}
|
||
|
exports.getGraphQLConfig = getGraphQLConfig;
|
||
|
function getGraphQLProjectConfig(rootDir, projectName) {
|
||
|
if (projectName === void 0) { projectName = process.env.GRAPHQL_CONFIG_PROJECT; }
|
||
|
return getGraphQLConfig(rootDir).getProjectConfig(projectName);
|
||
|
}
|
||
|
exports.getGraphQLProjectConfig = getGraphQLProjectConfig;
|