Skip to content

Commit

Permalink
simplify upgrade generator
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Feb 15, 2024
1 parent 036363e commit 8c633a2
Show file tree
Hide file tree
Showing 7 changed files with 301 additions and 419 deletions.
14 changes: 4 additions & 10 deletions cli/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,10 @@ const __dirname = dirname(__filename);
const currentNodeVersion = process.versions.node;
const minimumNodeVersion = packageJson.engines.node;

if (!process.argv.includes('--skip-checks')) {
if (
!semver.satisfies(currentNodeVersion, minimumNodeVersion) &&
// Allow upgrade to be executed using node 16 due to https://github.com/jhipster/generator-jhipster/issues/20349
(!process.argv.includes('upgrade') || !semver.satisfies(currentNodeVersion, '^16.0.0'))
) {
logger.fatal(
`You are running Node version ${currentNodeVersion}\nJHipster requires Node version ${minimumNodeVersion}\nPlease update your version of Node.`,
);
}
if (!process.argv.includes('--skip-checks') && !semver.satisfies(currentNodeVersion, minimumNodeVersion)) {
logger.fatal(
`You are running Node version ${currentNodeVersion}\nJHipster requires Node version ${minimumNodeVersion}\nPlease update your version of Node.`,
);
}

const appFolderOrWorkspaceRoot = existsSync('../node_modules') ? join(process.cwd(), '..') : process.cwd();
Expand Down
10 changes: 0 additions & 10 deletions generators/upgrade/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,6 @@ import { JHipsterCommandDefinition } from '../base/api.js';

const command: JHipsterCommandDefinition = {
options: {
targetJhipsterVersion: {
name: 'targetVersion',
description: 'Upgrade to a specific version instead of the latest',
type: String,
scope: 'generator',
},
targetBlueprintVersions: {
description: 'Upgrade to specific blueprint versions instead of the latest, e.g. --target-blueprint-versions [email protected],[email protected]',
type: String,
},
silent: {
description: 'Hides output of the generation process',
type: Boolean,
Expand Down
Loading

0 comments on commit 8c633a2

Please sign in to comment.