@@ -91,20 +91,13 @@ function copyRecursive(sourceRoot: string, destRoot: string, matchGlob: string)
91
91
} ) ;
92
92
}
93
93
94
- function leftPad ( str : string , minLength : number , padChar : string ) {
95
- while ( str . length < minLength ) {
96
- str = padChar + str ;
97
- }
98
- return str ;
99
- }
100
-
101
94
function getBuildNumber ( ) : string {
102
95
if ( process . env . APPVEYOR_BUILD_NUMBER ) {
103
- return leftPad ( process . env . APPVEYOR_BUILD_NUMBER , 6 , '0' ) ;
96
+ return process . env . APPVEYOR_BUILD_NUMBER ;
104
97
}
105
98
106
99
// 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' ;
108
101
}
109
102
110
103
function buildYeomanNpmPackage ( outputRoot : string ) {
@@ -206,10 +199,23 @@ function buildDotNetNewNuGetPackage(packageId: string) {
206
199
HostIdentifier : {
207
200
type : 'bind' ,
208
201
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'
209
208
}
210
209
} ,
211
210
tags : { language : 'C#' , type : 'project' } ,
212
211
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
+ } ,
213
219
/*
214
220
// Currently it doesn't appear to be possible to run `npm install` from a
215
221
// postAction, due to https://github.com/dotnet/templating/issues/849
@@ -245,7 +251,11 @@ function buildDotNetNewNuGetPackage(packageId: string) {
245
251
} ,
246
252
Framework : {
247
253
longName : 'framework'
248
- }
254
+ } ,
255
+ skipRestore : {
256
+ longName : 'no-restore' ,
257
+ shortName : ''
258
+ } ,
249
259
}
250
260
} , null , 2 ) ) ;
251
261
0 commit comments