@actions/tool-cache
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -33,5 +33,6 @@ export declare class HTTPError extends Error { | ||
* @param dest destination directory. Optional. | ||
* @param flags flags for the tar. Optional. | ||
* @returns path to the destination directory | ||
*/ | ||
export declare function extractTar(file: string, dest?: string): Promise<string>; | ||
export declare function extractTar(file: string, dest?: string, flags?: string): Promise<string>; | ||
/** | ||
@@ -38,0 +39,0 @@ * Extract a zip |
@@ -188,5 +188,6 @@ "use strict"; | ||
* @param dest destination directory. Optional. | ||
* @param flags flags for the tar. Optional. | ||
* @returns path to the destination directory | ||
*/ | ||
function extractTar(file, dest) { | ||
function extractTar(file, dest, flags = 'xz') { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -198,3 +199,3 @@ if (!file) { | ||
const tarPath = yield io.which('tar', true); | ||
yield exec_1.exec(`"${tarPath}"`, ['xzC', dest, '-f', file]); | ||
yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]); | ||
return dest; | ||
@@ -221,3 +222,8 @@ }); | ||
else { | ||
yield extractZipNix(file, dest); | ||
if (process.platform === 'darwin') { | ||
yield extractZipDarwin(file, dest); | ||
} | ||
else { | ||
yield extractZipNix(file, dest); | ||
} | ||
} | ||
@@ -255,2 +261,8 @@ return dest; | ||
} | ||
function extractZipDarwin(file, dest) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const unzipPath = path.join(__dirname, '..', 'scripts', 'externals', 'unzip-darwin'); | ||
yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest }); | ||
}); | ||
} | ||
/** | ||
@@ -257,0 +269,0 @@ * Caches a directory and installs it into the tool cacheDir |
{ | ||
"name": "@actions/tool-cache", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Actions tool-cache lib", | ||
@@ -47,4 +47,3 @@ "keywords": [ | ||
"nock": "^10.0.6" | ||
}, | ||
"gitHead": "a40bce7c8d382aa3dbadaa327acbc696e9390e55" | ||
} | ||
} |
@@ -11,3 +11,3 @@ # `@actions/tool-cache` | ||
``` | ||
```js | ||
const tc = require('@actions/tool-cache'); | ||
@@ -22,3 +22,3 @@ | ||
``` | ||
```js | ||
const tc = require('@actions/tool-cache'); | ||
@@ -46,3 +46,3 @@ | ||
``` | ||
```js | ||
const tc = require('@actions/tool-cache'); | ||
@@ -60,3 +60,3 @@ const core = require('@actions/core'); | ||
``` | ||
```js | ||
const tc = require('@actions/tool-cache'); | ||
@@ -71,3 +71,3 @@ | ||
``` | ||
```js | ||
const tc = require('@actions/tool-cache'); | ||
@@ -82,3 +82,3 @@ const core = require('@actions/core'); | ||
``` | ||
```js | ||
const tc = require('@actions/tool-cache'); | ||
@@ -85,0 +85,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
440891
526