Skip to content

Commit

Permalink
fix(angular): normalize remote directory correctly when using new pro…
Browse files Browse the repository at this point in the history
…ject root format (nrwl#18765)
  • Loading branch information
leosvelperez committed Aug 22, 2023
1 parent a2f7613 commit 9123271
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/angular/src/generators/host/host.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
formatFiles,
getProjects,
joinPathFragments,
runTasksInSerial,
stripIndents,
Tree,
Expand Down Expand Up @@ -86,9 +87,23 @@ export async function hostInternal(tree: Tree, options: Schema) {
}

for (const remote of remotesToGenerate) {
let remoteDirectory = options.directory;
if (
options.projectNameAndRootFormat === 'as-provided' &&
options.directory
) {
/**
* With the `as-provided` format, the provided directory would be the root
* of the host application. Append the remote name to the host parent
* directory to get the remote directory.
*/
remoteDirectory = joinPathFragments(options.directory, '..', remote);
}

await remoteGenerator(tree, {
...options,
name: remote,
directory: remoteDirectory,
host: hostProjectName,
skipFormat: true,
standalone: options.standalone,
Expand Down

0 comments on commit 9123271

Please sign in to comment.