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

branchinfo

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

branchinfo - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

index.es5.js

26

index.js

@@ -6,14 +6,19 @@ #!/usr/bin/env node

const child_process = require('child_process')
const { branchs } = require('./lib/read_gitbranch')
const colors = require('colors')
const spawn = child_process.spawn
const note_git_branch_info = require('./src/read_gitbranch').branchs
const colors = require('colors')
const Promise = global.Promise || require('bluebird')
let git_branch = spawn('git', ['branch'])
let gitBranch = spawn('git', ['branch'])
let output = ''
let native_branch = /^(?: |\n*\* |\n) {0,2}(.*)(?=\n|$)/
let nativeBranch = /^(?: |\n*\* |\n) {0,2}(.*)(?=\n|$)/
new Promise((resolve, reject) => {
git_branch.stdout.on('data', (data) => {
resolve(data.toString())
let branchString = ''
gitBranch.stdout.on('data', (data) => {
branchString += data.toString()
})
gitBranch.on('close', () => {
resolve(branchString)
})
})

@@ -23,12 +28,13 @@ .then(result => {

while(result.length > 0) {
let arr = result.match(native_branch)
let arr = result.match(nativeBranch)
result = result.substring(arr[0].length)
if(~arr[0].indexOf('*')) {
output += `\n* ${arr[1].green}${note_git_branch_info[arr[1]] ? ' - ' + note_git_branch_info[arr[1]].bold.underline : ''}`
output += `\n* ${arr[1].green}${branchs[arr[1]] ? ' - ' + branchs[arr[1]].bold.underline : ''}`
} else {
output += `${arr[0]}${note_git_branch_info[arr[1]] ? ' - ' + note_git_branch_info[arr[1]].bold : ''}`
output += `${arr[0]}${branchs[arr[1]] ? ' - ' + branchs[arr[1]].bold : ''}`
}
}
console.log(output)
process.stdout.write(output)
})
{
"name": "branchinfo",
"version": "1.0.3",
"description": "给git分支加注释,来清晰的记录git分支的作用",
"version": "1.0.4",
"description": "Give each git branch a note, to clearly record the role of each branch.",
"main": "index.js",

@@ -9,2 +9,3 @@ "scripts": {

},
"preferGlobal": true,
"repository": {

@@ -15,10 +16,11 @@ "type": "git",

"bin": {
"gb": "index.js"
"gb": "index.es5.js"
},
"keywords": [
"git",
"branch"
"branch",
"info"
],
"author": "",
"license": "ISC",
"author": "Jiang-Xuan",
"license": "MIT",
"bugs": {

@@ -29,4 +31,5 @@ "url": "https://github.com/Jiang-Xuan/gb/issues"

"dependencies": {
"bluebird": "^3.5.0",
"colors": "^1.1.2"
}
}
# branchinfo
给git分支加注释,解决分支过多无法分辨各个分支的作用的问题
> Give git branch notes. Because much git branch make me so difficult to understand.
> 给git分支加注释,解决分支过多无法分辨各个分支的作用的问题

@@ -5,0 +6,0 @@ ## Intro

Sorry, the diff of this file is not supported yet

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