99} from '@nx/devkit' ;
1010import { libraryGenerator } from '@nx/js' ;
1111import type { LibraryGeneratorSchema } from '@nx/js/src/generators/library/schema' ;
12- import path from 'node:path' ;
12+ import * as path from 'node:path' ;
1313import { createTreeWithEmptyWorkspace } from 'nx/src/generators/testing-utils/create-tree-with-empty-workspace' ;
1414import { executeProcess } from '@code-pushup/test-utils' ;
1515
@@ -98,7 +98,7 @@ export async function nxShowProjectJson<T extends ProjectConfiguration>(
9898 try {
9999 const { stderr, stdout } = await executeProcess ( {
100100 command : 'npx' ,
101- args : [ 'nx' , 'show' , 'project' , '--json' , project ] ,
101+ args : [ 'nx' , 'show' , 'project' , project , '--json' ] ,
102102 cwd,
103103 } ) ;
104104
@@ -109,13 +109,14 @@ export async function nxShowProjectJson<T extends ProjectConfiguration>(
109109 } ;
110110 } catch ( error : unknown ) {
111111 const execError = error as {
112- code ?: number ;
112+ code ?: number | string | null ;
113113 stderr ?: string ;
114114 stdout ?: string ;
115+ message ?: string ;
115116 } ;
116117 return {
117- code : execError . code ?? 1 ,
118- stderr : execError . stderr ?? String ( ( error as Error ) . message ) ,
118+ code : typeof execError . code === 'number' ? execError . code : 1 ,
119+ stderr : execError . stderr ?? execError . message ?? String ( error ) ,
119120 projectJson : JSON . parse ( '{}' ) ,
120121 } ;
121122 }
0 commit comments