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

@bowtie/cli

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bowtie/cli - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

src/actions/build.js

5

package.json
{
"name": "@bowtie/cli",
"version": "0.0.2",
"version": "0.0.3",
"description": "Internal BowTie CLI Tools",

@@ -28,4 +28,5 @@ "main": "index.js",

"dependencies": {
"cmr1-cli": "^0.1.6"
"cmr1-cli": "^0.1.8",
"shelljs": "^0.7.8"
}
}

35

src/cli.js
const Cmr1Cli = require('cmr1-cli');
const actions = require('./actions');
const ACTIONS = [
'clean',
'build',
'test'
]
const additionalOptions = [

@@ -17,3 +12,3 @@ {

description: 'Action to take',
typeLabel: ACTIONS.map(a => `[underline]{${a}}`).join(' | ')
typeLabel: Object.keys(actions).map(a => `[underline]{${a}}`).join(' | ')
}

@@ -30,7 +25,17 @@ ];

const handleAction = (action) => {
if (ACTIONS.indexOf(action) === -1) {
cli.warn('Invalid action!');
cli.debug(`Finding action: ${action}`);
cli.debug('Available actions:', JSON.stringify(Object.keys(actions), null, 2));
if (!actions[action]) {
cli.warn(`Action: '${action}' is invalid`);
cli.showHelp();
} else {
console.log('Running Action: ' + action);
cli.log(`Running action: ${action}`);
if (typeof actions[action] === 'function') {
actions[action]();
} else {
cli.warn(`Action: '${action}' is invalid`);
cli.showHelp();
}
}

@@ -41,4 +46,12 @@ }

run: () => {
cli.options.action.forEach(handleAction);
cli.debug('Running with options:');
cli.debug(JSON.stringify(cli.options, null, 2));
if (cli.options.action) {
cli.options.action.forEach(handleAction);
} else {
cli.warn('Missing action!');
cli.showHelp();
}
}
}
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