yy-get-git-info

1.0.6-2 • Public • Published

yy-get-git-info

在项目根目录下运行,可以获取项目的 Git 信息。

安装

$ npm install yy-get-git-info

使用

import {getRemoteInfo, getCompareUrlAsync } from "yy-get-git-info";

const remoteInfo = getRemoteInfo()
// 返回值如下
// {
//     domain: 'gitlab.xxx.com',
//     url: `https://${domain}/${userName}/${projectName}`,
//     userName: `yinshiyong`,
//     projectName: `gitlab repo name`,
//     port: `ssh|https port`
// }

const compareUrl = getCompareUrlAsync({mainBranch: 'develop'})
// 返回值如下
// `${gitRemoteInfo.url}/-/compare/${mainBranch}...${currentBranch}`

Readme

Keywords

none

Package Sidebar

Install

npm i yy-get-git-info

Weekly Downloads

0

Version

1.0.6-2

License

ISC

Unpacked Size

8.29 kB

Total Files

9

Last publish

Collaborators

  • shiyong.yin