Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 728b184

Browse files
In dotnet new templates, only show "npm install" instruction when executing in CLI
1 parent 9a59bcc commit 728b184

File tree

1 file changed

+5
-0
lines changed
  • templates/package-builder/src/build

1 file changed

+5
-0
lines changed

templates/package-builder/src/build/build.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ function buildDotNetNewNuGetPackage(packageId: string) {
203203
replaces: 'netcoreapp2.0',
204204
defaultValue: 'netcoreapp2.0'
205205
},
206+
HostIdentifier: {
207+
type: 'bind',
208+
binding: 'HostIdentifier'
209+
},
206210
skipRestore: {
207211
type: 'parameter',
208212
datatype: 'bool',
@@ -236,6 +240,7 @@ function buildDotNetNewNuGetPackage(packageId: string) {
236240
// For the preview2 release, just display manual instructions instead.
237241
// This is only applicable on the command line, because VS will restore
238242
// NPM packages automatically by default.
243+
condition: '(HostIdentifier == "dotnetcli" || HostIdentifier == "dotnetcli-preview")',
239244
actionId: 'AC1156F7-BB77-4DB8-B28F-24EEBCCA1E5C',
240245
description: '\n\n-------------------------------------------------------------------\nIMPORTANT: Before running this project on the command line,\n you must restore NPM packages by running "npm install"\n-------------------------------------------------------------------\n',
241246
manualInstructions: [{ text: 'Run "npm install"' }]

0 commit comments

Comments
 (0)