File tree Expand file tree Collapse file tree 3 files changed +41
-6
lines changed
packages/yarnpkg-core/sources Expand file tree Collapse file tree 3 files changed +41
-6
lines changed Original file line number Diff line number Diff line change 1+ releases :
2+ " @yarnpkg/cli " : patch
3+ " @yarnpkg/core " : patch
4+
5+ declined :
6+ - " @yarnpkg/plugin-compat"
7+ - " @yarnpkg/plugin-constraints"
8+ - " @yarnpkg/plugin-dlx"
9+ - " @yarnpkg/plugin-essentials"
10+ - " @yarnpkg/plugin-exec"
11+ - " @yarnpkg/plugin-file"
12+ - " @yarnpkg/plugin-git"
13+ - " @yarnpkg/plugin-github"
14+ - " @yarnpkg/plugin-http"
15+ - " @yarnpkg/plugin-init"
16+ - " @yarnpkg/plugin-interactive-tools"
17+ - " @yarnpkg/plugin-link"
18+ - " @yarnpkg/plugin-nm"
19+ - " @yarnpkg/plugin-npm"
20+ - " @yarnpkg/plugin-npm-cli"
21+ - " @yarnpkg/plugin-pack"
22+ - " @yarnpkg/plugin-patch"
23+ - " @yarnpkg/plugin-pnp"
24+ - " @yarnpkg/plugin-pnpm"
25+ - " @yarnpkg/plugin-stage"
26+ - " @yarnpkg/plugin-typescript"
27+ - " @yarnpkg/plugin-version"
28+ - " @yarnpkg/plugin-workspace-tools"
29+ - " @yarnpkg/builder"
30+ - " @yarnpkg/doctor"
31+ - " @yarnpkg/nm"
32+ - " @yarnpkg/pnpify"
33+ - " @yarnpkg/sdks"
Original file line number Diff line number Diff line change @@ -96,10 +96,14 @@ export class Manifest {
9696 static async tryFind ( path : PortablePath , { baseFs = new NodeFS ( ) } : { baseFs ?: FakeFS < PortablePath > } = { } ) {
9797 const manifestPath = ppath . join ( path , `package.json` as Filename ) ;
9898
99- if ( ! await baseFs . existsPromise ( manifestPath ) )
100- return null ;
99+ try {
100+ return await Manifest . fromFile ( manifestPath , { baseFs} ) ;
101+ } catch ( err ) {
102+ if ( err . code === `ENOENT` )
103+ return null ;
101104
102- return await Manifest . fromFile ( manifestPath , { baseFs} ) ;
105+ throw err ;
106+ }
103107 }
104108
105109 static async find ( path : PortablePath , { baseFs} : { baseFs ?: FakeFS < PortablePath > } = { } ) {
Original file line number Diff line number Diff line change @@ -41,9 +41,7 @@ export class Workspace {
4141
4242 async setup ( ) {
4343 // @ts -expect-error: It's ok to initialize it now
44- this . manifest = xfs . existsSync ( ppath . join ( this . cwd , Manifest . fileName ) )
45- ? await Manifest . find ( this . cwd )
46- : new Manifest ( ) ;
44+ this . manifest = await Manifest . tryFind ( this . cwd ) ?? new Manifest ( ) ;
4745
4846 // We use ppath.relative to guarantee that the default hash will be consistent even if the project is installed on different OS / path
4947 // @ts -expect-error: It's ok to initialize it now, even if it's readonly (setup is called right after construction)
You can’t perform that action at this time.
0 commit comments