diff --git a/packages/nx/src/command-line/init/implementation/react/check-for-uncommitted-changes.ts b/packages/nx/src/command-line/init/implementation/react/check-for-uncommitted-changes.ts index 7f3bb1c6a81b5..170b146ba2bce 100644 --- a/packages/nx/src/command-line/init/implementation/react/check-for-uncommitted-changes.ts +++ b/packages/nx/src/command-line/init/implementation/react/check-for-uncommitted-changes.ts @@ -1,12 +1,17 @@ import { execSync } from 'child_process'; export function checkForUncommittedChanges() { - const gitResult = execSync(`git status --porcelain`); - if (gitResult.length > 0) { + const gitResult = execSync('git status --porcelain').toString(); + + const filteredResults = gitResult + .split('\n') + .filter((line) => !line.includes('.nx') && line.trim().length > 0); + + if (filteredResults.length > 0) { console.log('❗️ Careful!'); console.log('You have uncommitted changes in your repository.'); console.log(''); - console.log(gitResult.toString()); + console.log(filteredResults.join('\n').toString()); console.log('Please commit your changes before running the migrator!'); process.exit(1); } diff --git a/packages/nx/src/project-graph/project-graph.ts b/packages/nx/src/project-graph/project-graph.ts index f3c4577c914a2..c6939bf09c242 100644 --- a/packages/nx/src/project-graph/project-graph.ts +++ b/packages/nx/src/project-graph/project-graph.ts @@ -13,8 +13,6 @@ import { stripIndents } from '../utils/strip-indents'; import { workspaceRoot } from '../utils/workspace-root'; import { CreateDependenciesError, - ProcessDependenciesError, - ProcessProjectGraphError, buildProjectGraphUsingProjectFileMap, } from './build-project-graph'; import { @@ -23,24 +21,14 @@ import { writeCache, } from './nx-deps-cache'; +import { ProjectConfigurationsError } from './error-types'; +import { loadNxPlugins } from './plugins/internal-api'; +import { ProjectGraphError } from './project-graph-error'; +import { ConfigurationResult } from './utils/project-configuration-utils'; import { retrieveProjectConfigurations, retrieveWorkspaceFiles, } from './utils/retrieve-workspace-files'; -import { - ConfigurationResult, - ConfigurationSourceMaps, -} from './utils/project-configuration-utils'; -import { - CreateNodesError, - MergeNodesError, - ProjectConfigurationsError, - ProjectsWithNoNameError, - ProjectsWithConflictingNamesError, -} from './error-types'; -import { DaemonProjectGraphError } from '../daemon/daemon-project-graph-error'; -import { loadNxPlugins, LoadedNxPlugin } from './plugins/internal-api'; -import { ProjectGraphError } from './project-graph-error'; /** * Synchronously reads the latest cached copy of the workspace's ProjectGraph.