Merge pull request #21133 from strapi/fix/dynamic-pkgjson-import

fix: use dynamic pkg.json import to get write pkg version during install
This commit is contained in:
Alexandre BODIN 2024-09-03 13:38:29 +02:00 committed by GitHub
commit d4ffbfa18b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,10 +3,10 @@ import os from 'node:os';
import chalk from 'chalk';
import commander from 'commander';
import crypto from 'crypto';
import fse from 'fs-extra';
import * as prompts from './prompts';
import { handleCloudLogin } from './cloud';
import { version } from '../package.json';
import { createStrapi } from './create-strapi';
import { checkNodeRequirements } from './utils/check-requirements';
import { checkInstallPath } from './utils/check-install-path';
@ -17,6 +17,8 @@ import { addDatabaseDependencies, getDatabaseInfos } from './utils/database';
import type { Options, Scope } from './types';
import { logger } from './utils/logger';
const { version } = fse.readJSONSync(join(__dirname, '..', 'package.json'));
const command = new commander.Command('create-strapi-app')
.version(version)
.arguments('[directory]')