ui5_easy_use
Version:
CLI tool for SAP ui5 and SAPUI5 projects to initialize apps, generate pages, insert form and table components, manage routing, and automate i18n bindings
16 lines (11 loc) • 648 B
JavaScript
const fs = require('fs');
const path = require('path');
const projectPackageJsonPath = path.resolve(process.cwd(), 'package.json');
const packageJson = require(projectPackageJsonPath);
// Add your custom script
packageJson.scripts = packageJson.scripts || {};
packageJson.scripts['c-mvc'] = "node node_modules/ui5_easy_use/create_auto_files/main.js";
packageJson.scripts['ez5'] = "EZ5_ENV=prd node node_modules/ui5_easy_use/dist/index.js";
// Write the updated package.json back to the project
fs.writeFileSync(projectPackageJsonPath, JSON.stringify(packageJson, null, 2));
console.log('ez5 script has been added to package.json');