0.2.1 • Published 8 years ago

vorto v0.2.1

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
8 years ago

Vorto.js

Build Status

Simple module to generate build numbers based on the latest git commit hash. This can be used with Gulp, or any other build system, when you're creating build artifacts.

Install

$ npm install vorto --save

Usage

vorto([format][, options], callback);

The format and options parameters are optional. The last argument must be a callback function of the de facto async standard function(err, version) {...}.

Formats

%h: 4dd41fa
%H: 4dd41fa4656cdbc7ed7d4dba0eeb8056f62c75a2
%ct-%h: 1448966785-4dd41fa
%j: 0.2.1

Read more about the pretty format options to see whats available.

Options

  • repo: specify the directory of the repository that you want to generate a version code for. The default is the current directory
  • git: specify a different path for the git command. The default is just git.

Examples

Generate short code:

var vorto = require("vorto");

vorto(function(err, version) {
    console.log("Version: " + version);
});

//Version: 8e0b117

Generate long code:

var vorto = require("vorto");

vorto("%H", function(err, version) {
    console.log("Version: " + version);
});

//Version: 271c4461c88bbe3ce11274caa1208ca0e57c1bf1

Generate with timestamp and hash:

var vorto = require("vorto");

vorto("%ct-%h", function(err, version) {
    console.log("Version: " + version);
});

//Version: 1448640790-7f562ba

Gulp example:

var gulp = require("gulp");
var vorto = require("vorto");

var GIT_VERSION;

gulp.task("version", function(cb) {
    vorto(function(err, version){
        GIT_VERSION = version;
        cb();
    });
});

LICENSE

The Apache 2.0 License

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago