UNPKG

@nx-dotnet/utils

Version:

This library was generated with [Nx](https://nx.dev).

23 lines 1.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getExecutedProjectConfiguration = void 0; const devkit_1 = require("@nx/devkit"); const getExecutedProjectConfiguration = (context) => { if (!context.projectName) { throw new Error('Project name must be set on executor context to run @nx-dotnet executors.'); } if (!context.projectGraph && !context.projectsConfigurations) { throw new Error('@nx-dotnet was unable to locate your projects configurations. ExecutorContext should contain projectGraph | projectsConfigurations'); } const possibleConfigurations = [ context.projectsConfigurations?.projects[context.projectName], context.projectGraph?.nodes[context.projectName].data, ].filter((x) => !!x); if (possibleConfigurations.length === 0) { throw new Error((0, devkit_1.stripIndents) `@nx-dotnet was unable to determine your projects configuration ExecutorContext: ${JSON.stringify(context, null, 2)}`); } return possibleConfigurations[0]; }; exports.getExecutedProjectConfiguration = getExecutedProjectConfiguration; //# sourceMappingURL=executors.js.map