mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
18 lines
389 B
JavaScript
18 lines
389 B
JavaScript
const { spawn } = require('child_process');
|
|
|
|
const PACKAGE_MANAGER_TO_COMMAND = {
|
|
npm: 'npx',
|
|
yarn1: 'npx',
|
|
yarn2: 'yarn dlx',
|
|
pnpm: 'pnpm dlx',
|
|
};
|
|
|
|
module.exports = function postinstall(options) {
|
|
const command = PACKAGE_MANAGER_TO_COMMAND[options.packageManager];
|
|
|
|
spawn(command, ['@storybook/auto-config', 'themes'], {
|
|
stdio: 'inherit',
|
|
cwd: process.cwd(),
|
|
});
|
|
};
|