mirror of
https://github.com/actions/setup-node.git
synced 2025-07-26 08:28:23 +02:00
Refactored code and removed redundant logic
This commit is contained in:
parent
bca281829f
commit
82441b3f82
4 changed files with 50 additions and 89 deletions
|
@ -5,7 +5,6 @@ import fs = require('fs');
|
|||
import * as path from 'path';
|
||||
import {restoreCache} from './cache-restore';
|
||||
import {URL} from 'url';
|
||||
import {parseNodeVersionFile} from './node-version-file';
|
||||
import os = require('os');
|
||||
|
||||
export async function run() {
|
||||
|
@ -24,12 +23,13 @@ export async function run() {
|
|||
|
||||
if (!!versionFile) {
|
||||
const versionFilePath = path.join(__dirname, '..', versionFile);
|
||||
version = await parseNodeVersionFile(
|
||||
version = await installer.parseNodeVersionFile(
|
||||
fs.readFileSync(versionFilePath, 'utf8')
|
||||
);
|
||||
core.info(`Resolved ${versionFile} as ${version}`);
|
||||
}
|
||||
}
|
||||
|
||||
let arch = core.getInput('architecture');
|
||||
const cache = core.getInput('cache');
|
||||
|
||||
|
@ -87,3 +87,4 @@ function isGhes(): boolean {
|
|||
);
|
||||
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue