Skip to content

Commit a5b142e

Browse files
committed
refactor: refacor code into short sentences
1 parent da33fc6 commit a5b142e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.suite-cli/cli/scripts/scripts.module.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1211,10 +1211,18 @@ const generateMCSHelper = ({ project_root, answers }) => {
12111211
const fileExtension = `${mcs}.js`;
12121212

12131213
// Write main file content
1214-
const mainContent = mcs === 'models' ? assets.modelContent({ answers }) : mcs === 'routes' ? assets.routesContent({ answers }) : mcs === 'controllers' ? assets.controllersContent({ answers }) : mcs === 'subscriber' ? assets.subscriberContent({ answers }) : assets.servicesContent({ answers });
1214+
const mainContent = mcs === 'models' ? assets.modelContent({ answers }) :
1215+
mcs === 'routes' ? assets.routesContent({ answers }) :
1216+
mcs === 'controllers' ? assets.controllersContent({ answers }) :
1217+
mcs === 'subscriber' ? assets.subscriberContent({ answers }) :
1218+
assets.servicesContent({ answers });
12151219
writeFileSync(join(mcsPath, `${fileExtension}`), mainContent);
12161220
// Write index file content
1217-
const indexContent = mcs === 'models' ? assets.modelIndexContent() : mcs === 'routes' ? assets.routesIndexContent() : mcs === 'controllers' ? assets.controllersIndexContent() : mcs === 'subscriber' ? assets.subscriberIndexContent() : assets.servicesIndexContent();
1221+
const indexContent = mcs === 'models' ? assets.modelIndexContent() :
1222+
mcs === 'routes' ? assets.routesIndexContent() :
1223+
mcs === 'controllers' ? assets.controllersIndexContent() :
1224+
mcs === 'subscriber' ? assets.subscriberIndexContent() :
1225+
assets.servicesIndexContent();
12181226
writeFileSync(join(mcsPath, 'index.js'), indexContent);
12191227
});
12201228
writeFile(join(`${project_root}/microservices/${answers.service_name}`, 'index.js'), assets.serverContent({ answers }));
@@ -1354,7 +1362,6 @@ const getExistingServices = ({ currentDir }) => {
13541362

13551363
const getExistingApps = ({ currentDir }) => {
13561364
const { apps } = readFileContent({ currentDir });
1357-
13581365
return apps
13591366
}
13601367

@@ -1451,7 +1458,6 @@ const scaffoldApp = ({ answers }) => {
14511458
generateNginxConfiguration({ services: answers.services, webserver_dir });
14521459
break
14531460
default:
1454-
14551461
ora().info('Handling other webservers');
14561462
}
14571463
generateKrakendConfiguration({
@@ -1470,6 +1476,7 @@ const readFileContent = ({ currentDir }) => {
14701476
const root_dir = generatRootPath({ currentDir, height: 5 })
14711477
// Read the project configuration file
14721478
const configPath = resolve(root_dir, 'suite.json');
1479+
console.log(currentDir,'d')
14731480
const project_config = JSON.parse(readFileSync(configPath, 'utf8'));
14741481
return project_config
14751482
}

0 commit comments

Comments
 (0)