mirror of
https://github.com/strapi/strapi.git
synced 2025-09-02 21:32:43 +00:00
Lint strapi-generate-new
This commit is contained in:
parent
0bfbdf8e72
commit
50598616f4
@ -24,9 +24,11 @@ const logger = require('strapi-utils').logger;
|
|||||||
* @param {Function} cb
|
* @param {Function} cb
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-disable no-console */
|
||||||
|
/* eslint-disable prefer-template */
|
||||||
module.exports = (scope, cb) => {
|
module.exports = (scope, cb) => {
|
||||||
const packageJSON = require(path.resolve(scope.rootPath, 'package.json'));
|
const packageJSON = require(path.resolve(scope.rootPath, 'package.json'));
|
||||||
const strapiRootPath = path.resolve(scope.strapiRoot, '..');
|
// const strapiRootPath = path.resolve(scope.strapiRoot, '..');
|
||||||
|
|
||||||
process.chdir(scope.rootPath);
|
process.chdir(scope.rootPath);
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
// Node.js core.
|
// Node.js core.
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const exec = require('child_process').exec;
|
const exec = require('child_process').exec;
|
||||||
const execSync = require('child_process').execSync;
|
|
||||||
|
|
||||||
// Public node modules.
|
// Public node modules.
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
@ -26,6 +26,7 @@ const logger = require('strapi-utils').logger;
|
|||||||
* @param {Function} cb
|
* @param {Function} cb
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* eslint-disable no-useless-escape */
|
||||||
module.exports = (scope, cb) => {
|
module.exports = (scope, cb) => {
|
||||||
// App info.
|
// App info.
|
||||||
const hasDatabaseConfig = !!scope.database;
|
const hasDatabaseConfig = !!scope.database;
|
||||||
@ -161,7 +162,7 @@ module.exports = (scope, cb) => {
|
|||||||
prefix: '',
|
prefix: '',
|
||||||
name: 'port',
|
name: 'port',
|
||||||
message: 'Port:',
|
message: 'Port:',
|
||||||
default: (answers) => {
|
default: (answers) => { // eslint-disable-line no-unused-vars
|
||||||
if (_.get(scope.database, 'port')) {
|
if (_.get(scope.database, 'port')) {
|
||||||
return scope.database.port;
|
return scope.database.port;
|
||||||
}
|
}
|
||||||
@ -213,7 +214,7 @@ module.exports = (scope, cb) => {
|
|||||||
])
|
])
|
||||||
.then(answers => {
|
.then(answers => {
|
||||||
if (hasDatabaseConfig) {
|
if (hasDatabaseConfig) {
|
||||||
answers = _.omit(scope.database.settings, ['client'])
|
answers = _.omit(scope.database.settings, ['client']);
|
||||||
}
|
}
|
||||||
|
|
||||||
scope.database.settings.host = answers.host;
|
scope.database.settings.host = answers.host;
|
||||||
|
@ -27,7 +27,7 @@ const watcher = (label, pckgName, type = 'front') => {
|
|||||||
const packagesPath = path.resolve(process.env.PWD, 'packages');
|
const packagesPath = path.resolve(process.env.PWD, 'packages');
|
||||||
shell.ls('* -d', packagesPath)
|
shell.ls('* -d', packagesPath)
|
||||||
// TODO temporary just for eslint
|
// TODO temporary just for eslint
|
||||||
.filter(package => package === 'strapi-generate-model')
|
.filter(package => package === 'strapi-generate-new')
|
||||||
// .filter(package => package !== 'README.md')
|
// .filter(package => package !== 'README.md')
|
||||||
.forEach(package => {
|
.forEach(package => {
|
||||||
watcher(`Testing ${package}`, package);
|
watcher(`Testing ${package}`, package);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user