Skip to content

Commit

Permalink
version 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafashykh committed May 22, 2021
1 parent 9358a2e commit b7a2f51
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion changes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = [
{
"files": "src/app.js",
"from": "var indexRouter = require('./routes/index');\nvar usersRouter = require('./routes/users');",
"to": ""
"to": "// Loading env\nrequire('dotenv').config();"
},
{
"files": ["*.js", "bin/www"],
Expand Down
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,15 @@ if(shell.exec('npm i').code !== 0) {
}

// Installing jsonwebtoken
shell.exec('npm install nodemon --save-dev')

shell.exec('npm i jsonwebtoken');

// Installig swagger
shell.exec('npm install swagger-ui-express');

// dotenv
shell.exec('npm install dotenv');

// ########################## CHANGES IN THE FILES ########################## //

Expand All @@ -144,7 +148,6 @@ for (let i = 0; i < changes.length; i++) {
}

// Adding and deleteing files
shell.exec('pwd');
shell.rm(['src/@routes/index.js', 'src/@routes/users.js']);
shell.exec('curl -H \'Cache-Control: no-cache\' https://raw.githubusercontent.com/mustafasheikh1/ps-express-generator/master/content/routes/index.js --output src/@routes/index.js');
shell.mkdir('src/@routes/default');
Expand All @@ -171,9 +174,8 @@ switch (selectedDb) {
"to": "// Routes\nrequire('./@routes')(app);\n// DB\nrequire('./@startup/db')();"
},
)
}
default: {
shell.echo('\nNO DB SELECTED\n');
shell.exec(`echo "db=''"|cat - .env > /tmp/out && mv /tmp/out .env`);
shell.echo('[MONGO_DB ADDED SUCCESSFULLY]');
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ps-express-generator",
"version": "1.0.8",
"version": "1.0.9",
"description": "Express Boilerplate Boilerplate based upto express-generator",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ This generator can also be further configured with the following command line fl
--git add .gitignore
-f, --force force on non-empty directory
-h, --help output usage information
(DATABASE)
--mongo adds mongoose

## License

Expand Down

0 comments on commit b7a2f51

Please sign in to comment.