New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cml-cli

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cml-cli - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

1

index.js

@@ -72,3 +72,2 @@ 'use strict';

else if (program.generate) {
console.log(chalk.underline.cyan.bold('Experimental feature.'));
}

@@ -75,0 +74,0 @@ else if (program.reset) {

18

lib/generate.js

@@ -8,2 +8,3 @@ var chalk = require('chalk');

var slugify = require('slugify');
var mkdirp = require('mkdirp');
var typeExtensions = {

@@ -36,2 +37,4 @@ element: ['jade', 'styl', 'md'],

_.each(names, function(name) {
console.log(chalk.green.bold('Generate resource type: ') + chalk.white.underline(type));
console.log(chalk.green.bold('Resource name: ') + chalk.white.underline(name));
_.each(extensions, function(extension) {

@@ -46,13 +49,8 @@ // template string + data for template

// target path
var filePath = path.join(config.sourceDir, config.sourcePaths.viewsDir, pluralize(type), name, name + '.' + extension);
// ensure directories exists before saving template
filePath.split('/').slice(0, -1).reduce(function(prev, curr, i) {
if (fs.existsSync(prev) === false) {
fs.mkdirSync(prev);
}
return prev + '/' + curr;
});
var filePath = path.join(config.sourceDir, config.sourcePaths.viewsDir, pluralize(type), name);
var fileName = name + '.' + extension;
mkdirp.sync(filePath);
// write file
fs.writeFileSync(filePath, data, 'utf-8');
console.log(chalk.green.bold('Success: ' + chalk.underline.white(filePath)));
fs.writeFileSync(path.join(filePath, fileName), data, 'utf-8');
console.log(chalk.green.bold('Success: ' + chalk.underline.white(fileName) + ' in ' + chalk.underline.white(filePath)));
});

@@ -59,0 +57,0 @@ });

{
"name": "cml-cli",
"version": "0.1.3",
"version": "0.1.4",
"description": "Simple wrapper for build scripts to stabilize API and to scaffold views and common patterns of cml-frontend boilerplate. Not for standalone usage.",

@@ -24,6 +24,7 @@ "bin": {

"chalk": "^1.0.0",
"commander": "~2.0.0",
"commander": "^2.0.0",
"fs-extra": "^0.18.3",
"get-port": "^1.0.0",
"lodash": "^3.9.3",
"mkdirp": "^0.5.1",
"pluralize": "^1.1.2",

@@ -30,0 +31,0 @@ "slugify": "^0.1.1",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc