Skip to content

Commit

Permalink
don't add migrate as a blueprint to application config. (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Jun 11, 2024
1 parent c4fdab3 commit b562fcd
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ permissions:
jobs:
migrate:
strategy:
fail-fast: false
matrix:
include:
- tests: 7.9.3-latest
Expand Down
8 changes: 2 additions & 6 deletions cli/cli.cjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/usr/bin/env node

const { dirname, basename, join } = require('path');
const { dirname, join } = require('path');
const { version, bin } = require('../package.json');

// Get package name to use as namespace.
// Allows blueprints to be aliased.
const packagePath = dirname(__dirname);
const packageFolderName = basename(packagePath);
const devBlueprintPath = join(packagePath, '.blueprint');
const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packageFolderName}` : packageFolderName;

(async () => {
const { runJHipster, done, logger } = await import('generator-jhipster/cli');
Expand All @@ -19,9 +17,7 @@ const blueprint = packageFolderName.startsWith('jhipster-') ? `generator-${packa
executableVersion: version,
defaultCommand: 'migrate',
devBlueprintPath,
blueprints: {
[blueprint]: version,
},
commands: require('./commands.cjs'),
printBlueprintLogo: () => {
console.log('===================== JHipster migrate =====================');
console.log('');
Expand Down
2 changes: 1 addition & 1 deletion cli/commands.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
migrate: {
description: 'Run migrate sub-generator (migrate blueprint)',
desc: 'Run migrate sub-generator (migrate blueprint)',
blueprint: 'generator-jhipster-migrate',
},
};
4 changes: 2 additions & 2 deletions generators/migrate/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ import {
import { GENERATOR_JHIPSTER } from 'generator-jhipster';
import command from './command.js';
import { GENERATOR_BOOTSTRAP } from 'generator-jhipster/generators';
import { fileURLToPath } from 'url';
import { normalizeBlueprintName } from './internal/blueprints.js';

export default class extends BaseGenerator {
Expand Down Expand Up @@ -553,7 +552,8 @@ export default class extends BaseGenerator {
}
}
} else if (jhipsterVersion === 'bundled') {
cli = join(fileURLToPath(new URL('../../cli/cli.cjs', import.meta.url)));
const packagePath = this.env.getPackagePath('jhipster:app');
cli = join(packagePath, 'dist/cli/jhipster.cjs');
cliOptions = ['app', ...cliOptions];
} else if (jhipsterVersion !== 'none') {
if (jhipsterVersion === 'current') {
Expand Down

0 comments on commit b562fcd

Please sign in to comment.