Add force-local flag to tar archiving on windows (#11914)

This commit adds the ability to archive tars on windows builds.
As windows filepaths have colons in them (i.e. c:/kibana)
tar thinks it is accessing a remote datasource.

Adding the --force-local flag tells tar to archive a local file.
This commit is contained in:
Colm O'Shea 2017-06-02 16:04:03 +01:00 committed by Jonathan Budzenski
parent 04ee900924
commit 829e0bd64d

View file

@ -16,7 +16,14 @@ export default (grunt) => {
if (/windows/.test(name)) {
await exec('zip', ['-rq', '-ll', zipPath, buildName]);
} else {
await exec('tar', ['-zchf', tarPath, buildName]);
const tarArguments = ['-zchf', tarPath, buildName];
// Add a flag to handle filepaths with colons (i.e. C://...) on windows
if (/^win/.test(process.platform)) {
tarArguments.push('--force-local');
}
await exec('tar', tarArguments);
}
}