How to use the git-rev-sync.tag function in git-rev-sync

To help you get started, we’ve selected a few git-rev-sync examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 4minitz / 4minitz / server / gitversioninfo.js View on Github external
gitVersionInfoUpdate: function () {
        try {
            var git = require('git-rev-sync');
            GIT_VERSION_INFO.commitshort = git.short();
            GIT_VERSION_INFO.commitlong = git.long();
            GIT_VERSION_INFO.branch = git.branch();
            GIT_VERSION_INFO.tag = git.tag();
            if (GIT_VERSION_INFO.tag == GIT_VERSION_INFO.commitlong) {  // no tag found!
                delete GIT_VERSION_INFO.tag;
            }

            console.log("git version:"+JSON.stringify(GIT_VERSION_INFO, null, 4));

        } catch (e) {
            console.log("No git-rev-sync installed? Do 'meteor npm install' before launch of meteor!");
            console.log(e);
        }
    }
});
github gxchain / gxchain-light / web / webpack.config.js View on Github external
{
            loader: "sass-loader",
            options: {
                outputStyle: "expanded"
            }
        }
    ];

    // OUTPUT PATH
    var outputPath = path.join(root_dir, "assets");

    // COMMON PLUGINS
    var plugins = [
        new webpack.optimize.OccurrenceOrderPlugin(),
        new webpack.DefinePlugin({
            APP_VERSION: JSON.stringify(git.tag()),
            __ELECTRON__: !!env.electron,
            __HASH_HISTORY__: !!env.hash,
            __BASE_URL__: JSON.stringify("baseUrl" in env ? env.baseUrl : "/"),
            __TESTNET__: !!env.testnet
        })
    ];

    // test environment
    plugins.push(new webpack.DefinePlugin({
        __TEST__: !!env.test
    }))

    var isProd = env.prod || env.test || env.testnet

    if (isProd) {
        // PROD OUTPUT PATH
github bitshares / bitshares-ui / webpack.config.js View on Github external
// COMMON PLUGINS
    const baseUrl = env.electron ? "" : "baseUrl" in env ? env.baseUrl : "/";

    /*
    * moment and react-intl include tons of locale files, use a regex and
    * ContextReplacementPlugin to only include certain locale files
    */
    let regexString = "";
    locales.forEach((l, i) => {
        regexString = regexString + (l + (i < locales.length - 1 ? "|" : ""));
    });
    const localeRegex = new RegExp(regexString);
    var plugins = [
        new webpack.optimize.OccurrenceOrderPlugin(),
        new webpack.DefinePlugin({
            APP_VERSION: JSON.stringify(git.tag()),
            __ELECTRON__: !!env.electron,
            __HASH_HISTORY__: !!env.hash,
            __BASE_URL__: JSON.stringify(baseUrl),
            __UI_API__: JSON.stringify(
                env.apiUrl || "https://ui.bitshares.eu/api"
            ),
            __TESTNET__: !!env.testnet,
            __DEPRECATED__: !!env.deprecated,
            __TEST__: false
        }),
        new webpack.ContextReplacementPlugin(
            /moment[\/\\]locale$/,
            localeRegex
        ),
        new webpack.ContextReplacementPlugin(
            /react-intl[\/\\]locale-data$/,
github bitshares / bitshares-ui / web / webpack.config.js View on Github external
{
            loader: "sass-loader",
            options: {
                outputStyle: "expanded"
            }
        }
    ];

    // OUTPUT PATH
    var outputPath = path.join(root_dir, "assets");

    // COMMON PLUGINS
    var plugins = [
        new webpack.optimize.OccurrenceOrderPlugin(),
        new webpack.DefinePlugin({
            APP_VERSION: JSON.stringify(git.tag()),
            __ELECTRON__: !!env.electron,
            __HASH_HISTORY__: !!env.hash,
            __BASE_URL__: JSON.stringify("baseUrl" in env ? env.baseUrl : "/"),
            __UI_API__: JSON.stringify(env.apiUrl || "https://ui.bitshares.eu/api"),
            __TESTNET__: !!env.testnet
        })
    ];

    if (env.prod) {
        // PROD OUTPUT PATH
        let outputDir = env.electron ? "electron" : env.hash ? "hash-history" : "dist";
        outputPath = path.join(root_dir, outputDir);

        // DIRECTORY CLEANER
        var cleanDirectories = [outputDir];
github m2-boilerplate / theme-frontend-bootstrap / gulpfile.js View on Github external
'use strict';

const gulp = require('gulp');

/*
 * Configure a Fractal instance.
 *
 * This configuration could also be done in a separate file, provided that this file
 * then imported the configured fractal instance from it to work with in your Gulp tasks.
 * i.e. const fractal = require('./my-fractal-config-file');
 */

const fractal = require('@frctl/fractal').create();
const git = require('git-rev-sync');

const version = 'v' + git.tag() + ' (' + git.short()+')';
fractal.set('project.title', 'Magento 2 Boilerplate Theme - ' + version); // title for the project
fractal.set('project.version', version);
fractal.set('project.author', 'Thomas Hampe');

fractal.web.set('builder.dest', __dirname + '/build/documentation/tmp'); // destination for the static export
fractal.docs.set('path', __dirname + '/styles/documentation'); // location of the documentation directory.
fractal.components.set('path', __dirname + '/styles/components'); // location of the component directory.
fractal.web.set('static.path', __dirname + '/web');

// any other configuration or customisation here

const logger = fractal.cli.console; // keep a reference to the fractal CLI console utility

var sass = require('gulp-sass');
 
gulp.task('styles', ['styles:vendor'], function () {
github dmnsgn / frontend-boilerplate / config / config.js View on Github external
const NODE_ENV = process.env.NODE_ENV;
const ROOT = process.env.PWD;
const PATHS = new Map()
  .set("config", "config")
  .set("src", "src")
  .set("dist", "dist")
  .set("test", "test");

const PACKAGE = JSON.parse(
  fs.readFileSync("./package.json", { encoding: "utf-8" })
);

const GIT_INFO = new Map()
  .set("GIT_VERSION", GitRevSync.count())
  .set("GIT_DATE", GitRevSync.date())
  .set("GIT_TAG", GitRevSync.tag())
  .set("GIT_HASH", GitRevSync.short());

const BANNER = `${PACKAGE.config.title}
${PACKAGE.description}
Compiled: ${Date()}
@version v${GitRevSync.count()}
@link ${PACKAGE.homepage}
@copyright ${PACKAGE.license}`;

// https://github.com/ai/browserslist
const BROWSERS = [
  "last 2 Android versions", // for Android WebView.
  "last 2 BlackBerry versions", // or bb for Blackberry browser.
  "last 2 Chrome versions", // for Google Chrome.
  "last 2 ChromeAndroid versions", // or and_chr for Chrome for Android
  "last 2 Edge versions", // for Microsoft Edge.
github stormpath / stormpath-widget / publish.js View on Github external
let throwIfVersionLessThanCurrentTag = (newVersion) => {
  const latestTag = git.tag();
  if (!semver.gt(newVersion, latestTag)) {
    throw new Error(`Proposed version ${newVersion} is not greater than current tag ${latestTag}`);
  }
};
github cloudwan / gohan_webui / webpack.config.js View on Github external
function version() {
  return {
    hash: gitSync.long(),
    tag: gitSync.tag(),
    version: process.env.npm_package_version
  };
}

git-rev-sync

Synchronously get the current git commit hash, tag, or branch

MIT
Latest version published 2 years ago

Package Health Score

50 / 100
Full package analysis

Similar packages