From e237646ed589b6b7edc9b6dd1cabd882879995ea Mon Sep 17 00:00:00 2001 From: Tyler Smalley Date: Wed, 23 Jan 2019 14:59:46 -0600 Subject: [PATCH] Decompress directly to data directory Co-Authored-By: joshdover --- packages/kbn-es/src/cluster.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/kbn-es/src/cluster.js b/packages/kbn-es/src/cluster.js index 3f493376cbc9..f522b7924bf6 100644 --- a/packages/kbn-es/src/cluster.js +++ b/packages/kbn-es/src/cluster.js @@ -19,6 +19,7 @@ const execa = require('execa'); const chalk = require('chalk'); +const path = require('path'); const { downloadSnapshot, installSnapshot, installSource, installArchive } = require('./install'); const { ES_BIN } = require('./paths'); const { log: defaultLog, parseEsLog, extractConfigFiles, decompress } = require('./utils'); @@ -124,12 +125,14 @@ exports.Cluster = class Cluster { * @param {String} archivePath */ async extractDataDirectory(installPath, archivePath) { - this._log.info(chalk.bold(`Extracing data directory`)); + this._log.info(chalk.bold(`Extracting data directory`)); this._log.indent(4); this._log.info(`Data archive: ${archivePath}`); this._log.info(`Install path: ${installPath}`); - await decompress(archivePath, installPath); + // decompress excludes the root directory as that is how our archives are + // structured. This works in our favor as we can explicitly extract into the data dir + await decompress(archivePath, path.resolve(installPath, 'data')); this._log.indent(-4); }