This is the result of another error I found when I was trying to do ampersand gen collection and it was complaining
path.js:7
throw new TypeError('Path must be a string. Received ' + inspect(path));
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.relative (path.js:1229:5)
at module.exports (/home/caleb/.nvm/versions/node/v6.7.0/lib/node_modules/ampersand/lib/generate-template.js:54:31)
at Object.<anonymous> (/home/caleb/.nvm/versions/node/v6.7.0/lib/node_modules/ampersand/bin/ampersand:59:5)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)
at Module.runMain (module.js:590:10)
|
if (type === 'router') { |
|
folderPath = path.join(config.approot, config.clientfolder); |
|
filePath = path.join(folderPath, (fileName || 'router.js')); |
|
} else if (type === 'model') { |
|
if (!name) quit('please specify a name: ampersand gen model ' + chalk.magenta('${your model name}')); |
|
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') { |
|
if (!name) quit('please specify a name: ampersand gen view ' + chalk.magenta('${your view name}')); |
|
folderPath = path.join(config.approot, config.clientfolder, config.viewfolder); |
|
filePath = path.join(folderPath, fileName); |
|
} else if (type === 'page') { |
|
if (!name) quit('please specify a name: ampersand gen page ' + chalk.magenta('${your page name}')); |
|
folderPath = path.join(config.approot, config.clientfolder, config.pagefolder); |
|
filePath = path.join(folderPath, fileName); |
|
} else if (type === 'form') { |
|
if (!name) quit('please specify a path to the model: ampersand gen form ' + chalk.magenta('${path to model}')); |
|
folderPath = path.join(config.approot, config.clientfolder, config.formsfolder); |
|
filePath = path.join(folderPath, path.basename(fileName)); |
|
} |
does not have an if case for collection even though the doc says that I can
ampersand gen collection
thus
|
config.relPath = path.relative(process.cwd(), filePath); |
complains about filePath being undefined.
This is the result of another error I found when I was trying to do
ampersand gen collectionand it was complainingampersand/lib/generate-template.js
Lines 29 to 50 in 116ea5c
does not have an if case for collection even though the doc says that I can
ampersand gen collectionthus
ampersand/lib/generate-template.js
Line 54 in 116ea5c