UNPKG

@aws-amplify/cli-internal

Version:
33 lines 1.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AmplifyConfigService = void 0; const amplify_cli_core_1 = require("@aws-amplify/amplify-cli-core"); class AmplifyConfigService { validateAmplifyProject() { const projectPath = amplify_cli_core_1.pathManager.findProjectRoot(); if (!projectPath) { throw new amplify_cli_core_1.AmplifyError('ProjectNotFoundError', { message: 'Not an Amplify project.', resolution: 'Run this command from an Amplify project directory.', }); } } getRootStackName() { var _a, _b; const projectPath = amplify_cli_core_1.pathManager.findProjectRoot(); const meta = amplify_cli_core_1.stateManager.getMeta(projectPath); const stackName = (_b = (_a = meta === null || meta === void 0 ? void 0 : meta.providers) === null || _a === void 0 ? void 0 : _a.awscloudformation) === null || _b === void 0 ? void 0 : _b.StackName; if (!stackName) { throw new amplify_cli_core_1.AmplifyError('StackNotFoundError', { message: 'Stack information not found in amplify-meta.json.', resolution: 'Has the project been deployed? Run "amplify push" to deploy your project.', }); } return stackName; } getProjectName() { return amplify_cli_core_1.stateManager.getProjectName(); } } exports.AmplifyConfigService = AmplifyConfigService; //# sourceMappingURL=amplify-config-service.js.map