Separate samples from templates

This commit is contained in:
Erjan Gavalji
2015-03-31 16:30:32 +03:00
parent 9b70127f4e
commit 556cf43fd4

View File

@ -33,8 +33,15 @@ module.exports = function(grunt) {
var currentAppName = grunt.task.current.data.appName; var currentAppName = grunt.task.current.data.appName;
return updatePackageDef(content, function(contentAsObject) { return updatePackageDef(content, function(contentAsObject) {
contentAsObject.version = localCfg.packageVersion; contentAsObject.version = localCfg.packageVersion;
if (currentAppName.indexOf("template-") == 0) {
var templateName = currentAppName.substring(0, "template-".length);
contentAsObject.name = "tns-" + currentAppName;
contentAsObject.description = "Nativescript " + templateName + " template";
}
else {
contentAsObject.name = "tns-samples-" + currentAppName; contentAsObject.name = "tns-samples-" + currentAppName;
contentAsObject.description = "Nativescript " + currentAppName + " sample application"; contentAsObject.description = "Nativescript " + currentAppName + " sample application";
}
contentAsObject.license = "BSD"; contentAsObject.license = "BSD";
if (!contentAsObject.repository) { if (!contentAsObject.repository) {
contentAsObject.repository = {}; contentAsObject.repository = {};