Comparing version 3.0.4 to 3.0.5
@@ -18,2 +18,4 @@ var fs = require('fs'); | ||
var folderPath; | ||
var collectionPath; | ||
var collectionToModelPath; | ||
var file; | ||
@@ -35,3 +37,5 @@ var fileName; | ||
folderPath = path.join(config.approot, config.clientfolder, config.modelfolder); | ||
collectionPath = path.join(config.approot, config.clientfolder, config.collectionfolder); | ||
filePath = path.join(folderPath, fileName); | ||
collectionToModelPath = path.join(path.relative(collectionPath, folderPath), name).replace(/\\/g, '/'); | ||
} else if (type === 'view') { | ||
@@ -61,5 +65,6 @@ if (!name) quit('please specify a name: ampersand gen view ' + chalk.magenta('${your view name}')); | ||
config.name = name; | ||
config.collectionToModelPath = collectionToModelPath; | ||
genTypes.model(config, function (err, result) { | ||
var modelFilePath = path.join(config.folderPath, result.modelFileName); | ||
var collectionFilePath = path.join(config.folderPath, result.collectionFileName); | ||
var collectionFilePath = path.join(collectionPath, result.collectionFileName); | ||
fsExtra.createFileSync(modelFilePath); | ||
@@ -66,0 +71,0 @@ fs.writeFileSync(modelFilePath, clean(result.model, config), 'utf8'); |
// {{{ name }}} Collection - {{{ collectionFileName }}}.js | ||
var AmpCollection = require('ampersand-rest-collection'); | ||
var {{{ name }}} = require('./{{{ fileName }}}'); | ||
var {{{ name }}} = require('{{{ collectionToModelPath }}}'); | ||
@@ -5,0 +5,0 @@ |
{ | ||
"name": "ampersand", | ||
"description": "CLI tool for generating single page apps a. la. http://humanjavascript.com", | ||
"version": "3.0.4", | ||
"version": "3.0.5", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -6,0 +6,0 @@ "bin": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
858524
22210