From c2e4d4f261d29194eb39513d29a32c167043330f Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 27 Jul 2017 14:41:55 +0100 Subject: [PATCH] Re-enable the "dotnet restore" postAction, like the stock templates --- templates/package-builder/src/build/build.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/templates/package-builder/src/build/build.ts b/templates/package-builder/src/build/build.ts index a7aa382..40d4fc0 100644 --- a/templates/package-builder/src/build/build.ts +++ b/templates/package-builder/src/build/build.ts @@ -206,10 +206,23 @@ function buildDotNetNewNuGetPackage(packageId: string) { HostIdentifier: { type: 'bind', binding: 'HostIdentifier' + }, + skipRestore: { + type: 'parameter', + datatype: 'bool', + description: 'If specified, skips the automatic restore of the project on create.', + defaultValue: 'false' } }, tags: { language: 'C#', type: 'project' }, postActions: [ + { + condition: '(!skipRestore)', + description: 'Restore NuGet packages required by this project.', + manualInstructions: [{ text: 'Run \'dotnet restore\'' }], + actionId: '210D431B-A78B-4D2F-B762-4ED3E3EA9025', + continueOnError: true + }, /* // Currently it doesn't appear to be possible to run `npm install` from a // postAction, due to https://github.com/dotnet/templating/issues/849 @@ -245,7 +258,11 @@ function buildDotNetNewNuGetPackage(packageId: string) { }, Framework: { longName: 'framework' - } + }, + skipRestore: { + longName: 'no-restore', + shortName: '' + }, } }, null, 2));