Socket
Socket
Sign inDemoInstall

all-contributors-cli

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

all-contributors-cli - npm Package Compare versions

Comparing version 3.0.6 to 3.0.7

lib/util/config-file.test.js

15

cli.js

@@ -5,3 +5,2 @@ #!/usr/bin/env node

var fs = require('fs');
var path = require('path');

@@ -35,7 +34,6 @@ var yargs = require('yargs');

try {
return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
return util.configFile.readConfig(configPath);
} catch (error) {
if (configPath !== defaultRCFile) {
console.error(error.message);
process.exit(1);
onError(error);
}

@@ -85,3 +83,4 @@ }

if (error) {
return console.error(error);
console.error(error.message);
process.exit(1);
}

@@ -91,8 +90,2 @@ }

function promptForCommand(argv, cb) {
try {
fs.statSync(argv.config);
} catch (error) { // No config file --> first time using the command
return cb('init');
}
var questions = [{

@@ -99,0 +92,0 @@ type: 'list',

@@ -7,3 +7,10 @@ 'use strict';

function readConfig(configPath) {
return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
try {
return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
} catch (error) {
if (error.code === 'ENOENT') {
throw new Error('Configuration file not found: ' + configPath);
}
throw error;
}
}

@@ -16,3 +23,8 @@

function writeContributors(configPath, contributors, cb) {
var config = readConfig(configPath);
var config;
try {
config = readConfig(configPath);
} catch (error) {
return cb(error);
}
var content = _.assign(config, {contributors: contributors});

@@ -19,0 +31,0 @@ return writeConfig(configPath, content, cb);

{
"name": "all-contributors-cli",
"version": "3.0.6",
"version": "3.0.7",
"description": "Tool to easily add recognition for new contributors",

@@ -5,0 +5,0 @@ "bin": {

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