UNPKG

ecommerce

Version:

Easily create Ecommerce sites powered by Hanzo.

39 lines (30 loc) 960 B
// Generated by CoffeeScript 1.11.1 var Command, copy, fs, path, templatePath, templates; Command = require('ronin').Command; fs = require('fs'); path = require('path'); copy = require('recursive-copy'); templatePath = path.join(__dirname, '../../templates'); templates = fs.readdirSync(templatePath); module.exports = Command.extend({ desc: 'Create new ecommerce site', options: { template: 'string' }, run: function(template, name) { if (name == null) { console.log('name required'); return; } if (!((template != null) || template === '')) { template = 'standard-landing-page'; } if ((templates.indexOf(template)) === -1) { console.log('template not found, try one of ' + templates.join(', ')); return; } copy(path.join(templatePath, template), path.join(process.cwd(), name)); return console.log('created new ecommerce site ' + name); } }); //# sourceMappingURL=new.js.map