kibana/tasks/config/build.js
Court Ewing 7eaa1915f4 Uppercase -SNAPSHOT on snapshot builds
This is consistent with other Elastic projects.
2016-06-15 18:33:04 -04:00

16 lines
483 B
JavaScript

import { execSync as exec } from 'child_process';
export default (grunt) => {
const pkgVersion = grunt.config.get('pkg.version');
const sha = String(exec('git rev-parse HEAD')).trim();
const number = parseFloat(String(exec('git log --format="%h" | wc -l')).trim());
const version = buildVersion(grunt.option('release'), pkgVersion);
return { sha, number, version };
};
function buildVersion(isRelease, version) {
return isRelease ? version : `${version}-SNAPSHOT`;
}