File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed
utils/src/lib/utility-functions Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ export default async function (
1212 dotnetClient = new DotNetClient ( dotnetFactory ( ) ) ,
1313) {
1414 const projects = await getNxDotnetProjects ( host ) ;
15- for ( const project of projects . values ( ) ) {
16- const projectFiles = getProjectFilesForProject ( host , project ) ;
15+ for ( const [ projectName , project ] of projects . entries ( ) ) {
16+ const projectFiles = getProjectFilesForProject ( host , project , projectName ) ;
1717 for ( const file of projectFiles ) {
1818 dotnetClient . restorePackages ( file ) ;
1919 }
Original file line number Diff line number Diff line change @@ -18,7 +18,11 @@ export default async function (host: Tree) {
1818 const projects = await getNxDotnetProjects ( host ) ;
1919
2020 for ( const [ projectName , configuration ] of projects . entries ( ) ) {
21- const projectFiles = getProjectFilesForProject ( host , configuration ) ;
21+ const projectFiles = getProjectFilesForProject (
22+ host ,
23+ configuration ,
24+ projectName ,
25+ ) ;
2226 for ( const f of projectFiles ) {
2327 const xmldoc = readXml ( host , f ) ;
2428 console . log ( `Scanning packages for ${ projectName } (${ f } )` ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,11 @@ export async function updateDependencyVersions(
1414) {
1515 const projects = await getNxDotnetProjects ( host ) ;
1616 for ( const [ projectName , configuration ] of projects . entries ( ) ) {
17- const projectFiles = getProjectFilesForProject ( host , configuration ) ;
17+ const projectFiles = getProjectFilesForProject (
18+ host ,
19+ configuration ,
20+ projectName ,
21+ ) ;
1822 for ( const f of projectFiles ) {
1923 const xmldoc = readXml ( host , f ) ;
2024 let updateFile = false ;
Original file line number Diff line number Diff line change @@ -115,12 +115,13 @@ export async function getNxDotnetProjects(
115115export function getProjectFilesForProject (
116116 host : Tree ,
117117 project : ProjectConfiguration | undefined ,
118+ projectName : string ,
118119) {
119- if ( ! project ?. sourceRoot ) {
120- throw new Error ( ' Unable to read source root for project!' ) ;
120+ if ( ! project ?. sourceRoot && ! project ?. root ) {
121+ throw new Error ( ` Unable to read source root for project ${ projectName } ` ) ;
121122 }
122123 return host
123- . children ( project . sourceRoot )
124+ . children ( project . sourceRoot ?? project . root )
124125 . filter ( ( x ) => x . endsWith ( 'proj' ) )
125126 . map ( ( x ) => `${ project . sourceRoot } /${ x } ` ) ;
126127}
You can’t perform that action at this time.
0 commit comments