UNPKG

@sap/cds-dk

Version:

Command line client and development toolkit for the SAP Cloud Application Programming Model

29 lines (23 loc) 827 B
const cds = require('../../../cds') const { exists } = cds.utils const { readProject } = require('../../projectReader') const { merge, sort } = require('../../merge') const { mvn } = require('../../add') module.exports = class MtaTemplate extends require('../../plugin') { static help() { return 'Cloud Foundry deployment using mta.yaml' } static hasInProduction() { return exists('mta.yaml') } async run() { const project = readProject() await merge(__dirname, 'files/package.json').into('package.json') await sort('package.json', 'devDependencies') if (project.isJava) await mvn.add('cf') } async combine() { const project = readProject() await merge(__dirname, 'files/mta.yaml.hbs').into('mta.yaml', { with: project }) } }