1
0
Fork 0

await tc.downloadTool (#337)

pull/341/head
Fabio Niephaus 2020-02-10 04:15:26 +01:00 committed by GitHub
parent 432a78c48c
commit 0ecc141d4e
1 changed files with 2 additions and 2 deletions

View File

@ -22,11 +22,11 @@ These can then be extracted in platform specific ways:
const tc = require('@actions/tool-cache');
if (process.platform === 'win32') {
const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip');
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip');
const node12ExtractedFolder = await tc.extractZip(node12Path, 'path/to/extract/to');
// Or alternately
const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z');
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z');
const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to');
}
else {