Skip to content

Commit

Permalink
fix(core): Correct yarn version detection
Browse files Browse the repository at this point in the history
  • Loading branch information
0420syj committed May 24, 2023
1 parent 2f9f551 commit 47ec4f5
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 @@ -9,7 +9,7 @@

import fs from 'fs-extra';
import path from 'path';
import yaml from 'js-yaml';
import Yaml from 'js-yaml';
import {createRequire} from 'module';
import logger from '@docusaurus/logger';
import semver from 'semver';
Expand Down Expand Up @@ -119,8 +119,8 @@ export default async function beforeCli() {
}

try {
const yamlData = yaml.load(await fs.readFile(path.resolve('.yarnrc.yml'), 'utf8'));

const yamlData = Yaml.load(await fs.readFile(path.resolve('.yarnrc.yml'), 'utf8'));
// @ts-expect-error: yamlData is not typed
const isYarn2PlusUsed = 'yarnPath' in yamlData && !yamlData.yarnPath.includes('yarn-1.');
return isYarn2PlusUsed
? `yarn up ${siteDocusaurusPackagesForUpdate}`
Expand Down

0 comments on commit 47ec4f5

Please sign in to comment.