From 941ae9a34d4f2ce54d2e6f365a52e77bd375bdf8 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 23 May 2017 10:06:35 +0100 Subject: [PATCH] Add postActions to "dotnet new" templates --- templates/package-builder/src/build/build.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/templates/package-builder/src/build/build.ts b/templates/package-builder/src/build/build.ts index 7f935ee..3299aeb 100644 --- a/templates/package-builder/src/build/build.ts +++ b/templates/package-builder/src/build/build.ts @@ -167,6 +167,20 @@ function buildDotNetNewNuGetPackage() { } }, tags: { language: 'C#', type: 'project' }, + postActions: [{ + condition: '(!skipRestore)', + description: 'Restores NuGet packages required by this project.', + manualInstructions: [{ text: 'Run \'dotnet restore\'' }], + actionId: '210D431B-A78B-4D2F-B762-4ED3E3EA9025', + continueOnError: true + }, { + condition: '(!skipRestore)', + description: 'Restores NPM packages required by this project.', + manualInstructions: [{ text: 'Run \'npm install\'' }], + actionId: '3A7C4B45-1F5D-4A30-959A-51B88E82B5D2', + args: { executable: 'npm', args: 'install' }, + continueOnError: false + }], }, null, 2)); fs.writeFileSync(path.join(templateConfigDir, 'dotnetcli.host.json'), JSON.stringify({