Skip to content

Commit

Permalink
refactor indexFile
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim9999 committed Jul 23, 2022
1 parent 9a6adf9 commit daa5405
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,10 @@ isFolderExists('./tests/_generated');

console.info('MODE: ', process.env.PARSE, '');

// TODO rewrite on object
switch (process.env.PARSE) {
case 'full':
// generateFullTemplate();
generateFullTemplateHackernoon(FULL_SOURCE);
break;
const modeMap = {
full: () => generateFullTemplateHackernoon(FULL_SOURCE),
// reactContentOnly: () => generateReactContent(CONTENT_SOURCE),
// reactFull: () => generateReactFullTemplate(FULL_SOURCE),
};

case 'reactContentOnly':
// same as default, but with react components instead.
// generateReactContent(CONTENT_SOURCE);
break;

case 'reactFull':
// generateReactFullTemplate(FULL_SOURCE);
break;

default:
// generateFullTemplate(FULL_SOURCE);
break;
}
modeMap[process.env.PARSE ?? 'full']();

0 comments on commit daa5405

Please sign in to comment.