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

@clevercanyon/madrun

Package Overview
Dependencies
Maintainers
2
Versions
203
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@clevercanyon/madrun - npm Package Compare versions

Comparing version 1.0.13 to 1.0.14

46

cli.js

@@ -7,2 +7,4 @@ #!/usr/bin/env node

import _ꓺomit from 'lodash/omit.js';
import fs from 'node:fs';

@@ -14,3 +16,4 @@ import path from 'node:path';

import * as se from 'shescape';
import _ꓺomit from 'lodash/omit.js';
import spawn from 'spawn-please';
import { execSync } from 'node:child_process';

@@ -22,6 +25,4 @@ import coloredBox from 'boxen';

import { hideBin } from 'yargs/helpers';
import { execSync } from 'node:child_process';
const __dirname = dirname(import.meta.url);
const pkgFile = path.resolve(__dirname, './package.json');

@@ -112,7 +113,7 @@ const pkg = JSON.parse(fs.readFileSync(pkgFile).toString());

}
await this.exec(fs.existsSync(pkgLockFile) || fs.existsSync(npmShrinkwrapFile) ? 'npm ci' : 'npm install');
await this.spawn('npm', fs.existsSync(pkgLockFile) || fs.existsSync(npmShrinkwrapFile) ? ['ci'] : ['install']);
}
/**
* Executes command line operation(s).
* Executes command line operation.
*

@@ -122,9 +123,38 @@ * @param {string} cmd CMD + any args.

*
* @returns {Promise<string>} Command output.
* @returns {Promise<string>} Empty string when `stdio: 'inherit'` (default). Stdout when `stdio: 'pipe'`.
*/
async exec(cmd, opts = {}) {
return execSync(cmd, {
return (
execSync(cmd, {
cwd: this.cwd,
shell: 'bash',
stdio: 'inherit',
encoding: 'utf-8',
env: {
...process.env,
PARENT_IS_TTY:
process.stdout.isTTY || //
process.env.PARENT_IS_TTY
? true
: false,
},
...opts,
}) || ''
);
}
/**
* Spawns command line operation.
*
* @param {string} cmd CMD.
* @param {string[]} args Arguments.
* @param {object} opts Any additional options.
*
* @returns {Promise<string>} Empty string when `stdio: 'inherit'` (default). Stdout when `stdio: 'pipe'`.
*/
async spawn(cmd, args = [], opts = {}) {
return await spawn(cmd, args, {
cwd: this.cwd,
stdio: [0, 1, 2],
shell: 'bash',
stdio: 'inherit',
env: {

@@ -131,0 +161,0 @@ ...process.env,

3

package.json

@@ -7,3 +7,3 @@ {

"license": "MIT",
"version": "1.0.13",
"version": "1.0.14",
"name": "@clevercanyon/madrun",

@@ -41,4 +41,5 @@ "description": "Runs commands configured by a JS file; in sequence.",

"shescape": "npm:@clevercanyon/shescape.fork@^1.6.4",
"spawn-please": "npm:@clevercanyon/spawn-please.fork@^2.0.2",
"yargs": "^17.6.2"
}
}
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