mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Allow build configuration to run on Windows machines (#9951)
This commit is contained in:
parent
741c053768
commit
8029e048b2
1 changed files with 9 additions and 1 deletions
|
@ -1,11 +1,19 @@
|
|||
import { execSync as exec } from 'child_process';
|
||||
const platform = require('os').platform();
|
||||
|
||||
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);
|
||||
let number;
|
||||
|
||||
if (/^win/.test(platform)) {
|
||||
// Windows does not have the wc process and `find /C /V ""` does not consistently work
|
||||
number = String(exec('git log --format="%h"')).split('\n').length;
|
||||
} else {
|
||||
number = parseFloat(String(exec('git log --format="%h" | wc -l')).trim());
|
||||
}
|
||||
|
||||
return { sha, number, version };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue