Skip to content

Commit

Permalink
fix review
Browse files Browse the repository at this point in the history
  • Loading branch information
monxxi committed Jun 16, 2020
1 parent 0b8802c commit 2388ce4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 56 deletions.
10 changes: 3 additions & 7 deletions generators/app/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ function writeFiles(generator) {
return shelljs.cat(constants.MODULES_HOOK_FILE).match(constants.MODULE_NAME) === null;
};

const isCleanup = generator => {
return generator.props.cleanup ? generator.props.cleanup : false;
};

/**
* add dependencies according to the build tool present in the application.
* @param generator
Expand Down Expand Up @@ -219,7 +215,7 @@ function writeFiles(generator) {
}
};

if (isCleanup(generator)) {
if (generator.props.cleanup) {
shelljs.rm('-rf', `${generator.javaDir}service/kafka/`, `${generator.javaDir}web/rest/kafka/`);
}

Expand Down Expand Up @@ -260,13 +256,13 @@ function writeFiles(generator) {
const kafkaPreviousConfiguration = utils.getPreviousKafkaConfiguration(
generator,
`${jhipsterConstants.SERVER_MAIN_RES_DIR}config/application.yml`,
isFirstGeneration() || isCleanup(generator)
isFirstGeneration() || generator.props.cleanup
);

const kafkaPreviousTestConfiguration = utils.getPreviousKafkaConfiguration(
generator,
`${jhipsterConstants.SERVER_TEST_RES_DIR}config/application.yml`,
isFirstGeneration() || isCleanup(generator)
isFirstGeneration() || generator.props.cleanup
);

// eslint-disable-next-line no-template-curly-in-string
Expand Down
3 changes: 1 addition & 2 deletions generators/app/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ function askForOperations(generator) {
type: 'confirm',
name: 'cleanup',
message: 'Do you want to clean up your current Kafka configuration?',
default: false,
validate: input => (_.lowerCase(input) !== 'y' && _.lowerCase(input) !== 'n' ? 'Please enter Y or N' : true)
default: false
}
];

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion generators/app/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
topicNamingFormat
};

// This is a default topic naming convention which can be updated (see also application-kafka.yml.ejs)
function topicNamingFormat(baseName, name) {
return `queuing.${baseName}.${name}`;
}
Expand Down
4 changes: 2 additions & 2 deletions test/app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('JHipster generator kafka', () => {
});
});

describe('with --force --skip-prompts options', () => {
describe('with --skip-prompts options', () => {
before(done => {
helpers
.run(path.join(__dirname, '../generators/app'))
Expand Down Expand Up @@ -408,7 +408,7 @@ describe('JHipster generator kafka', () => {
});

describe('with an existing previous generation', () => {
describe('with --force --skip-prompts options', () => {
describe('with --skip-prompts options', () => {
before(done => {
helpers
.run(path.join(__dirname, '../generators/app'))
Expand Down

0 comments on commit 2388ce4

Please sign in to comment.