Skip to content

Commit

Permalink
Code cleanup 👍
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Feb 24, 2019
1 parent cb62a95 commit 6880848
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
10 changes: 5 additions & 5 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const codesplitfn = require('../lib/commands/codesplitlib');
const addPackagefn = require('../lib/commands/addPackagelib');
const routesfn = require('../lib/commands/routeslib');
const configfn = require('../lib/commands/configlib');
const serverfn = require('../lib/run/server');
const clientfn = require('../lib/run/client');
const { setupServer } = require('../lib/run/server');
const { setupClient } = require('../lib/run/client');
const dockerfn = require('../lib/deploy/docker');
const git_repofn = require('../lib/deploy/git_repo');
const dplyfn = require('../lib/deploy/docker_dply');
Expand Down Expand Up @@ -72,12 +72,12 @@ program
program
.command('run:client')
.description('To run client')
.action(clientfn);
.action(setupClient);

program
.command('run:server')
.description('To run server')
.action(serverfn);
.action(setupServer);

program
.command('dockerize')
Expand All @@ -100,7 +100,7 @@ program
program.outputHelp();
console.log(` ` + chalk.red(`\n Unknown command ${chalk.yellow(cmd)}.`));
console.log();
});
});

program.parse(process.argv);

Expand Down
4 changes: 1 addition & 3 deletions lib/run/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { setupProject } = require('./launch');
const { appData } = require('../utils/projectConfig');
const showBanner = require('../external/banner');

let clientfn = () => {
exports.setupClient = () => {
showBanner();
if(!fs.existsSync('./mevn.json')){
console.log(chalk.red.bold('\n Make sure that you are having a valid MEVN stack project in path'));
Expand All @@ -25,5 +25,3 @@ let clientfn = () => {
setupProject('npm run dev');
});
};

module.exports = clientfn;
4 changes: 1 addition & 3 deletions lib/run/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { setupProject } = require('./launch');
const { appData } = require('../utils/projectConfig');
const showBanner = require('../external/banner');

let serverfn = () => {
exports.setupServer = () => {
showBanner();
if(!fs.existsSync('./mevn.json')){
console.log(chalk.red.bold('\n Make sure that you are having a valid MEVN stack project in path'));
Expand All @@ -23,5 +23,3 @@ let serverfn = () => {
setupProject('npm start');
});
};

module.exports = serverfn;

0 comments on commit 6880848

Please sign in to comment.