From 41882bf16f9cd05f66851de523c4b989fd884464 Mon Sep 17 00:00:00 2001 From: Jason Jean Date: Fri, 3 Jun 2022 14:18:20 -0400 Subject: [PATCH] fix(core): fix outputs migration (#10575) --- .../replace-all-relative-outputs-with-absolute.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts b/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts index b7d7cd6793043..17af41ff8c3ee 100644 --- a/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts +++ b/packages/nx/src/migrations/update-14-2-0/replace-all-relative-outputs-with-absolute.ts @@ -3,11 +3,15 @@ import { getProjects, updateProjectConfiguration, } from '../../generators/utils/project-configuration'; -import { isRelativePath } from 'nx/src/utils/fileutils'; -import { joinPathFragments } from 'nx/src/utils/path'; +import { isRelativePath } from '../../utils/fileutils'; +import { joinPathFragments } from '../../utils/path'; +import { formatChangedFilesWithPrettierIfAvailable } from '../../generators/internal-utils/format-changed-files-with-prettier-if-available'; export default async function (tree: Tree) { for (const [name, value] of getProjects(tree).entries()) { + if (!value.targets) { + continue; + } for (const t of Object.values(value.targets)) { if (t.outputs) { t.outputs = t.outputs.map((o) => @@ -17,4 +21,5 @@ export default async function (tree: Tree) { } updateProjectConfiguration(tree, name, value); } + await formatChangedFilesWithPrettierIfAvailable(tree); }