@@ -91,20 +91,13 @@ function copyRecursive(sourceRoot: string, destRoot: string, matchGlob: string)
9191 } ) ;
9292}
9393
94- function leftPad ( str : string , minLength : number , padChar : string ) {
95- while ( str . length < minLength ) {
96- str = padChar + str ;
97- }
98- return str ;
99- }
100-
10194function getBuildNumber ( ) : string {
10295 if ( process . env . APPVEYOR_BUILD_NUMBER ) {
103- return leftPad ( process . env . APPVEYOR_BUILD_NUMBER , 6 , '0' ) ;
96+ return process . env . APPVEYOR_BUILD_NUMBER ;
10497 }
10598
10699 // For local builds, use timestamp
107- return 't-' + Math . floor ( ( new Date ( ) . valueOf ( ) - new Date ( 2017 , 0 , 1 ) . valueOf ( ) ) / ( 60 * 1000 ) ) ;
100+ return Math . floor ( ( new Date ( ) . valueOf ( ) - new Date ( 2017 , 0 , 1 ) . valueOf ( ) ) / ( 60 * 1000 ) ) + '-local' ;
108101}
109102
110103function buildYeomanNpmPackage ( outputRoot : string ) {
@@ -206,10 +199,23 @@ function buildDotNetNewNuGetPackage(packageId: string) {
206199 HostIdentifier : {
207200 type : 'bind' ,
208201 binding : 'HostIdentifier'
202+ } ,
203+ skipRestore : {
204+ type : 'parameter' ,
205+ datatype : 'bool' ,
206+ description : 'If specified, skips the automatic restore of the project on create.' ,
207+ defaultValue : 'false'
209208 }
210209 } ,
211210 tags : { language : 'C#' , type : 'project' } ,
212211 postActions : [
212+ {
213+ condition : '(!skipRestore)' ,
214+ description : 'Restore NuGet packages required by this project.' ,
215+ manualInstructions : [ { text : 'Run \'dotnet restore\'' } ] ,
216+ actionId : '210D431B-A78B-4D2F-B762-4ED3E3EA9025' ,
217+ continueOnError : true
218+ } ,
213219 /*
214220 // Currently it doesn't appear to be possible to run `npm install` from a
215221 // postAction, due to https://github.com/dotnet/templating/issues/849
@@ -245,7 +251,11 @@ function buildDotNetNewNuGetPackage(packageId: string) {
245251 } ,
246252 Framework : {
247253 longName : 'framework'
248- }
254+ } ,
255+ skipRestore : {
256+ longName : 'no-restore' ,
257+ shortName : ''
258+ } ,
249259 }
250260 } , null , 2 ) ) ;
251261
0 commit comments