Skip to content

Commit 996aaee

Browse files
author
Ben Callaghan
committed
feat(core): create tool manifest during init
Create the manifest file so future generators can install local tools Fixes #44
1 parent d02b0b7 commit 996aaee

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

packages/core/src/generators/init/generator.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ import {
66
WorkspaceConfiguration,
77
writeJson,
88
} from '@nrwl/devkit';
9+
import { DotNetClient, dotnetFactory } from '@nx-dotnet/dotnet';
910

1011
import { CONFIG_FILE_PATH, NxDotnetConfig } from '@nx-dotnet/utils';
1112

12-
export default async function (host: Tree) {
13+
export default async function (
14+
host: Tree,
15+
dotnetClient = new DotNetClient(dotnetFactory()),
16+
) {
1317
const initialized = host.isFile(CONFIG_FILE_PATH);
1418

1519
const configObject: NxDotnetConfig = initialized
@@ -26,6 +30,8 @@ export default async function (host: Tree) {
2630
if (!initialized) {
2731
updateGitIgnore(host, readWorkspaceConfiguration(host));
2832
}
33+
34+
initToolManifest(host, dotnetClient);
2935
}
3036

3137
function updateGitIgnore(
@@ -59,3 +65,11 @@ function updateNxJson(host: Tree) {
5965
}
6066
writeJson(host, 'nx.json', nxJson);
6167
}
68+
69+
function initToolManifest(host: Tree, dotnetClient: DotNetClient) {
70+
const initialized = host.exists('.config/dotnet-tools.json');
71+
if (!initialized) {
72+
console.log('Tool Manifest created for managing local .NET tools');
73+
dotnetClient.new('tool-manifest');
74+
}
75+
}

0 commit comments

Comments
 (0)