mirror of
https://github.com/strapi/strapi.git
synced 2025-09-04 14:23:03 +00:00
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:
commit
d4ffbfa18b
@ -3,10 +3,10 @@ import os from 'node:os';
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import commander from 'commander';
|
import commander from 'commander';
|
||||||
import crypto from 'crypto';
|
import crypto from 'crypto';
|
||||||
|
import fse from 'fs-extra';
|
||||||
|
|
||||||
import * as prompts from './prompts';
|
import * as prompts from './prompts';
|
||||||
import { handleCloudLogin } from './cloud';
|
import { handleCloudLogin } from './cloud';
|
||||||
import { version } from '../package.json';
|
|
||||||
import { createStrapi } from './create-strapi';
|
import { createStrapi } from './create-strapi';
|
||||||
import { checkNodeRequirements } from './utils/check-requirements';
|
import { checkNodeRequirements } from './utils/check-requirements';
|
||||||
import { checkInstallPath } from './utils/check-install-path';
|
import { checkInstallPath } from './utils/check-install-path';
|
||||||
@ -17,6 +17,8 @@ import { addDatabaseDependencies, getDatabaseInfos } from './utils/database';
|
|||||||
import type { Options, Scope } from './types';
|
import type { Options, Scope } from './types';
|
||||||
import { logger } from './utils/logger';
|
import { logger } from './utils/logger';
|
||||||
|
|
||||||
|
const { version } = fse.readJSONSync(join(__dirname, '..', 'package.json'));
|
||||||
|
|
||||||
const command = new commander.Command('create-strapi-app')
|
const command = new commander.Command('create-strapi-app')
|
||||||
.version(version)
|
.version(version)
|
||||||
.arguments('[directory]')
|
.arguments('[directory]')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user