Skip to content

Commit

Permalink
return early for npm upgrade command
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Apr 20, 2023
1 parent 2c72a76 commit d7fd239
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/docusaurus/bin/beforeCli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ export default async function beforeCli() {

const getUpgradeCommand = async () => {
const isYarnUsed = await fs.pathExists(path.resolve('yarn.lock'));
const isYarnClassicUsed = !(await fs.pathExists(
path.resolve('.yarnrc.yml'),
));
if (!isYarnUsed) {
return `npm i ${siteDocusaurusPackagesForUpdate}`;
}

const isYarnClassicUsed = !(await fs.pathExists(
path.resolve('.yarnrc.yml'),
));
return isYarnClassicUsed
? `yarn upgrade ${siteDocusaurusPackagesForUpdate}`
: `yarn up ${siteDocusaurusPackagesForUpdate}`;
Expand Down

0 comments on commit d7fd239

Please sign in to comment.