UNPKG

kibana-123

Version:

Kibana is an open source (Apache Licensed), browser based analytics and search dashboard for Elasticsearch. Kibana is a snap to setup and start using. Kibana strives to be easy to get started with, while also being flexible and powerful, just like Elastic

29 lines (24 loc) 840 B
const exec = require('child_process').execFileSync; const stat = require('fs').statSync; const fromRoot = require('path').resolve.bind(null, __dirname, '../'); module.exports = function (grunt) { grunt.registerTask('setup_kibana', function () { const kbnDir = fromRoot('../kibana'); const kbnGitDir = fromRoot('../kibana/.git'); try { if (stat(kbnGitDir).isDirectory()) { exec('git', ['pull', 'origin', 'master'], { cwd: kbnDir }); } else { throw new Error(`${kbnGitDir} is not a directory??`); } } catch (error) { if (error.code === 'ENOENT') { exec('git', ['clone', 'https://github.com/elastic/kibana.git', kbnDir]); } else { throw error; } } exec('npm', ['prune'], { cwd: kbnDir }); exec('npm', ['install'], { cwd: kbnDir }); }); };