Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update cache npm module to latest
  • Loading branch information
Lovepreet Singh committed Aug 4, 2022
1 parent 4387dbc commit 85efbb5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 25 deletions.
20 changes: 13 additions & 7 deletions dist/restore/index.js
Expand Up @@ -1113,7 +1113,13 @@ function resolvePaths(patterns) {
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
core.debug(`Matched: ${relativeFile}`);
// Paths are made relative so the tar entries are all relative to the root of the workspace.
paths.push(`${relativeFile}`);
if (relativeFile === '') {
// path.relative returns empty string if workspace and file are equal
paths.push('.');
}
else {
paths.push(`${relativeFile}`);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
Expand Down Expand Up @@ -37272,9 +37278,9 @@ function extractTar(archivePath, compressionMethod) {
function getCompressionProgram() {
switch (compressionMethod) {
case constants_1.CompressionMethod.Zstd:
return ['--use-compress-program', 'zstd -d --long=30'];
return ['--use-compress-program', 'unzstd --long=30'];
case constants_1.CompressionMethod.ZstdWithoutLong:
return ['--use-compress-program', 'zstd -d'];
return ['--use-compress-program', 'unzstd'];
default:
return ['-z'];
}
Expand Down Expand Up @@ -37305,9 +37311,9 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
function getCompressionProgram() {
switch (compressionMethod) {
case constants_1.CompressionMethod.Zstd:
return ['--use-compress-program', 'zstd -T0 --long=30'];
return ['--use-compress-program', 'zstdmt --long=30'];
case constants_1.CompressionMethod.ZstdWithoutLong:
return ['--use-compress-program', 'zstd -T0'];
return ['--use-compress-program', 'zstdmt'];
default:
return ['-z'];
}
Expand Down Expand Up @@ -37338,9 +37344,9 @@ function listTar(archivePath, compressionMethod) {
function getCompressionProgram() {
switch (compressionMethod) {
case constants_1.CompressionMethod.Zstd:
return ['--use-compress-program', 'zstd -d --long=30'];
return ['--use-compress-program', 'unzstd --long=30'];
case constants_1.CompressionMethod.ZstdWithoutLong:
return ['--use-compress-program', 'zstd -d'];
return ['--use-compress-program', 'unzstd'];
default:
return ['-z'];
}
Expand Down
20 changes: 13 additions & 7 deletions dist/save/index.js
Expand Up @@ -1113,7 +1113,13 @@ function resolvePaths(patterns) {
.replace(new RegExp(`\\${path.sep}`, 'g'), '/');
core.debug(`Matched: ${relativeFile}`);
// Paths are made relative so the tar entries are all relative to the root of the workspace.
paths.push(`${relativeFile}`);
if (relativeFile === '') {
// path.relative returns empty string if workspace and file are equal
paths.push('.');
}
else {
paths.push(`${relativeFile}`);
}
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
Expand Down Expand Up @@ -37272,9 +37278,9 @@ function extractTar(archivePath, compressionMethod) {
function getCompressionProgram() {
switch (compressionMethod) {
case constants_1.CompressionMethod.Zstd:
return ['--use-compress-program', 'zstd -d --long=30'];
return ['--use-compress-program', 'unzstd --long=30'];
case constants_1.CompressionMethod.ZstdWithoutLong:
return ['--use-compress-program', 'zstd -d'];
return ['--use-compress-program', 'unzstd'];
default:
return ['-z'];
}
Expand Down Expand Up @@ -37305,9 +37311,9 @@ function createTar(archiveFolder, sourceDirectories, compressionMethod) {
function getCompressionProgram() {
switch (compressionMethod) {
case constants_1.CompressionMethod.Zstd:
return ['--use-compress-program', 'zstd -T0 --long=30'];
return ['--use-compress-program', 'zstdmt --long=30'];
case constants_1.CompressionMethod.ZstdWithoutLong:
return ['--use-compress-program', 'zstd -T0'];
return ['--use-compress-program', 'zstdmt'];
default:
return ['-z'];
}
Expand Down Expand Up @@ -37338,9 +37344,9 @@ function listTar(archivePath, compressionMethod) {
function getCompressionProgram() {
switch (compressionMethod) {
case constants_1.CompressionMethod.Zstd:
return ['--use-compress-program', 'zstd -d --long=30'];
return ['--use-compress-program', 'unzstd --long=30'];
case constants_1.CompressionMethod.ZstdWithoutLong:
return ['--use-compress-program', 'zstd -d'];
return ['--use-compress-program', 'unzstd'];
default:
return ['-z'];
}
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "cache",
"version": "3.0.5",
"version": "3.0.6",
"private": true,
"description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js",
Expand All @@ -23,7 +23,7 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.0.0",
"@actions/cache": "^3.0.1",
"@actions/core": "^1.7.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
Expand Down

0 comments on commit 85efbb5

Please sign in to comment.