Skip to content

Commit

Permalink
fix(core): sync command should list package names (#41)
Browse files Browse the repository at this point in the history
fixes #39
  • Loading branch information
AgentEnder authored May 6, 2021
1 parent 5f2d5c9 commit 8bdc66a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/core/src/generators/nuget-reference/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default async function (
options.version,
configuredPkgVersion,
options.allowVersionMismatch,
options.packageName,
);
config.nugetPackages[options.packageName] = resolvedVersion;
if (
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/generators/sync/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default async function (host: Tree) {
version,
configuredVersion,
false,
pkg,
);
// console.log('Resolved:', resolved)
config.nugetPackages[pkg] = resolved;
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/generators/sync/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"id": "Sync",
"title": "",
"type": "object",
"description": "Syncs package versions across the workspace with nx-dotnet config.",
"properties": {}
}
10 changes: 7 additions & 3 deletions packages/core/src/generators/utils/resolve-version-mismatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export async function resolveVersionMismatch(
desired: string | undefined,
configured: string | undefined,
allowVersionMismatch: boolean,
packageName: string | undefined,
): Promise<string> {
if (configured) {
if (configured !== desired) {
Expand All @@ -28,8 +29,9 @@ export async function resolveVersionMismatch(
short: 'Allow mismatch',
},
],
message:
'There appears to be a mismatch between your current package preferences and the requested version. Which version would you like to use?',
message: `There appears to be a mismatch between your current package preferences and the requested version ${
packageName ? 'for ' + packageName : ''
}. Which version would you like to use?`,
},
]);
return resolution;
Expand All @@ -40,7 +42,9 @@ export async function resolveVersionMismatch(
const { choice } = await prompt([
{
name: 'choice',
message: `You have not yet set a version for this package. Which version would you like to install?`,
message: `You have not yet set a version for ${
packageName ? packageName : 'this package'
}. Which version would you like to install?`,
},
]);
return choice;
Expand Down

0 comments on commit 8bdc66a

Please sign in to comment.