Skip to content

Commit

Permalink
fix(core): adjust nx import messaging without relative source dir (#2…
Browse files Browse the repository at this point in the history
…8052)

(cherry picked from commit 6634693)
  • Loading branch information
MaxKless authored and FrozenPandaz committed Sep 27, 2024
1 parent 33ff88e commit 0735b65
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions packages/nx/src/command-line/import/utils/prepare-source-repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ export async function prepareSourceRepo(
join(gitClient.root, source)
);

const message = relativeSourceDir.trim()
? `Filtering git history to only include files in ${relativeSourceDir}`
: `Filtering git history`;

if (await gitClient.hasFilterRepoInstalled()) {
spinner.start(
`Filtering git history to only include files in ${relativeSourceDir}`
);
spinner.start(message);
await gitClient.filterRepo(relativeSourceDir, relativeDestination);
} else {
spinner.start(
`Filtering git history to only include files in ${relativeSourceDir} (this might take a few minutes -- install git-filter-repo for faster performance)`
`${message} (this might take a few minutes -- install git-filter-repo for faster performance)`
);
await gitClient.filterBranch(
relativeSourceDir,
Expand All @@ -35,7 +37,9 @@ export async function prepareSourceRepo(
);
}
spinner.succeed(
`Filtered git history to only include files in ${relativeSourceDir}`
relativeSourceDir.trim()
? `Filtered git history to only include files in ${relativeSourceDir}`
: `Filtered git history`
);

spinner.succeed(
Expand Down

0 comments on commit 0735b65

Please sign in to comment.