New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

git-label-cli

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-label-cli - npm Package Compare versions

Comparing version
1.1.1
to
1.2.0
+23
dist/lib/repo.js
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getRepo = getRepo;
var _fs = require('fs');
/**
* Extracts the git repo (name/repo) from the provided path.
*
* @name getRepo
* @function
* @param {string} path the path to extract the git information from
* @return {Promise} the extracted repo (name/repo)
*/
function getRepo(path) {
return (/(:)(.+)(\.git)/g.exec((0, _fs.readFileSync)(path, 'utf8'))[2].split('/').filter(function (key, index, xs) {
return index > xs.length - 3;
}).join('/')
);
}
import {readFileSync} from 'fs';
/**
* Extracts the git repo (name/repo) from the provided path.
*
* @name getRepo
* @function
* @param {string} path the path to extract the git information from
* @return {Promise} the extracted repo (name/repo)
*/
export function getRepo(path) {
return (/(:)(.+)(\.git)/g).exec(readFileSync(path, 'utf8'))[2]
.split('/')
.filter((key, index, xs) => index > xs.length - 3)
.join('/');
}
+5
-3

@@ -1,2 +0,2 @@

"use strict";
'use strict';

@@ -8,6 +8,8 @@ Object.defineProperty(exports, "__esModule", {

var _inquirer = require("inquirer");
var _inquirer = require('inquirer');
var _inquirer2 = _interopRequireDefault(_inquirer);
var _repo = require('./repo');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -43,3 +45,3 @@

function promptServer() {
var questions = [{ type: "input", name: "api", message: "api url", default: "https://api.github.com" }, { type: "input", name: "token", message: "api token" }, { type: "input", name: "repo", message: "repo name [username/repo]" }];
var questions = [{ type: "input", name: "api", message: "api url", default: "https://api.github.com" }, { type: "input", name: "repo", message: "repo name [username/repo]", default: (0, _repo.getRepo)('.git/config') }, { type: "input", name: "token", message: "api token" }];

@@ -46,0 +48,0 @@ return new Promise(function (resolve, reject) {

{
"name": "git-label-cli",
"description": "CLI utility for git-label",
"version": "1.1.1",
"version": "1.2.0",
"homepage": "https://github.com/jasonbellamy",

@@ -6,0 +6,0 @@ "author": {

import inquirer from 'inquirer';
import {getRepo} from './repo';

@@ -37,4 +38,4 @@

{type: "input", name: "api", message: "api url", default: "https://api.github.com"},
{type: "input", name: "token", message: "api token"},
{type: "input", name: "repo", message: "repo name [username/repo]"}
{type: "input", name: "repo", message: "repo name [username/repo]", default: getRepo('.git/config')},
{type: "input", name: "token", message: "api token"}
];

@@ -41,0 +42,0 @@