mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-21 21:16:59 +02:00
feat(v2): skip dependency install on docusaurus init (#3986)
* fix: #3450 Signed-off-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> * test: fix failing test Signed-off-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
This commit is contained in:
parent
869e118e4f
commit
0bb5e547b1
4 changed files with 22 additions and 10 deletions
|
@ -43,6 +43,7 @@ export default async function init(
|
|||
reqTemplate?: string,
|
||||
cliOptions: Partial<{
|
||||
useNpm: boolean;
|
||||
skipInstall: boolean;
|
||||
}> = {},
|
||||
): Promise<void> {
|
||||
const useYarn = !cliOptions.useNpm ? hasYarn() : false;
|
||||
|
@ -155,14 +156,15 @@ export default async function init(
|
|||
}
|
||||
|
||||
const pkgManager = useYarn ? 'yarn' : 'npm';
|
||||
if (!cliOptions.skipInstall) {
|
||||
console.log(`Installing dependencies with: ${chalk.cyan(pkgManager)}`);
|
||||
|
||||
console.log(`Installing dependencies with: ${chalk.cyan(pkgManager)}`);
|
||||
|
||||
try {
|
||||
shell.exec(`cd "${name}" && ${useYarn ? 'yarn' : 'npm install'}`);
|
||||
} catch (err) {
|
||||
console.log(chalk.red('Installation failed'));
|
||||
throw err;
|
||||
try {
|
||||
shell.exec(`cd "${name}" && ${useYarn ? 'yarn' : 'npm install'}`);
|
||||
} catch (err) {
|
||||
console.log(chalk.red('Installation failed'));
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
console.log();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue