fix tar finding on windows using the wrong tar

This commit is contained in:
Gordon MacPherson 2020-07-11 11:08:33 +01:00
parent 7d0857fb6f
commit 283942680f

15
dist/restore/index.js vendored
View file

@ -5180,21 +5180,6 @@ const utils = __importStar(__webpack_require__(15));
const constants_1 = __webpack_require__(931); const constants_1 = __webpack_require__(931);
function getTarPath(args, compressionMethod) { function getTarPath(args, compressionMethod) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const IS_WINDOWS = process.platform === 'win32';
if (IS_WINDOWS) {
const systemTar = `${process.env['windir']}\\System32\\tar.exe`;
if (compressionMethod !== constants_1.CompressionMethod.Gzip) {
// We only use zstandard compression on windows when gnu tar is installed due to
// a bug with compressing large files with bsdtar + zstd
//args.push('--force-local');
}
else if (fs_1.existsSync(systemTar)) {
return systemTar;
}
else if (yield utils.isGnuTarInstalled()) {
// args.push('--force-local');
}
}
return yield io.which('tar', true); return yield io.which('tar', true);
}); });
} }