Giter Site home page Giter Site logo

gitstamp-cli's Introduction

gitstamp-cli

用于工程编包时写入Git信息

说明

本工具需在安装Git客户端的环境下使用,且运行目录为Git仓库目录

使用

  1. 安装 npm install gitstamp-cli -s

  2. 写入当前Git信息npx gitstamp,建议在script中使用。打包命令前执行Git信息写入命令,如 package.json

    ...
      "scripts": {
            "dev": "npx gitstamp && webpack serve",
            "build": "npx gitstamp && npx webpack build",
            "start": "npm run dev"
        },
    ...
  3. 载入Git信息

    main.js

    import gitstamp from 'gitstamp-cli';
    console.log(gitstamp)
    // 获得如下结构的对象,你可以写入任何你想要写入的地方。
    //{
    //    "branch": "XXX",
    //    "commitID": "XXX",
    //    "commitDate": "XXX",
    //    "commitAuthor": "XXX",
    //    "commitMessage": "XXX"
    //}

开发

  1. 执行npm install 安装依赖
  2. 执行CLI 脚本node ./bin/index.js

gitstamp-cli's People

Contributors

mornmartin avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.