Skip to content

Commit

Permalink
Decompress directly to data directory
Browse files Browse the repository at this point in the history
Co-Authored-By: joshdover <me@joshdover.com>
  • Loading branch information
tylersmalley and joshdover committed Jan 23, 2019
1 parent d74df66 commit e237646
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/kbn-es/src/cluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit e237646

Please sign in to comment.