From 728b18431dbe731d4cfbbde4c98c1c35d097a667 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Sun, 11 Jun 2017 19:28:51 +0100 Subject: [PATCH] In dotnet new templates, only show "npm install" instruction when executing in CLI --- templates/package-builder/src/build/build.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/package-builder/src/build/build.ts b/templates/package-builder/src/build/build.ts index d5d246e..cb549b5 100644 --- a/templates/package-builder/src/build/build.ts +++ b/templates/package-builder/src/build/build.ts @@ -203,6 +203,10 @@ function buildDotNetNewNuGetPackage(packageId: string) { replaces: 'netcoreapp2.0', defaultValue: 'netcoreapp2.0' }, + HostIdentifier: { + type: 'bind', + binding: 'HostIdentifier' + }, skipRestore: { type: 'parameter', datatype: 'bool', @@ -236,6 +240,7 @@ function buildDotNetNewNuGetPackage(packageId: string) { // For the preview2 release, just display manual instructions instead. // This is only applicable on the command line, because VS will restore // NPM packages automatically by default. + condition: '(HostIdentifier == "dotnetcli" || HostIdentifier == "dotnetcli-preview")', actionId: 'AC1156F7-BB77-4DB8-B28F-24EEBCCA1E5C', description: '\n\n-------------------------------------------------------------------\nIMPORTANT: Before running this project on the command line,\n you must restore NPM packages by running "npm install"\n-------------------------------------------------------------------\n', manualInstructions: [{ text: 'Run "npm install"' }]