File tree Expand file tree Collapse file tree
libraries/rush-lib/src/logic/pnpm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,10 +67,17 @@ export class PnpmWorkspaceFile extends BaseWorkspaceFile {
6767 public static async loadCatalogsFromFileAsync (
6868 workspaceYamlFilename : string
6969 ) : Promise < Record < string , Record < string , string > > | undefined > {
70- if ( ! ( await FileSystem . existsAsync ( workspaceYamlFilename ) ) ) {
71- return undefined ;
70+ let content : string ;
71+ try {
72+ content = await FileSystem . readFileAsync ( workspaceYamlFilename ) ;
73+ } catch ( error ) {
74+ if ( FileSystem . isNotExistError ( error ) ) {
75+ return undefined ;
76+ } else {
77+ throw error ;
78+ }
7279 }
73- const content : string = await FileSystem . readFileAsync ( workspaceYamlFilename ) ;
80+
7481 const parsed : IPnpmWorkspaceYaml | undefined = yamlModule . load ( content ) as IPnpmWorkspaceYaml | undefined ;
7582
7683 return parsed ?. catalogs ;
You can’t perform that action at this time.
0 commit comments