mirror of
https://github.com/actions/setup-node.git
synced 2026-02-18 12:24:44 +08:00
Merge remote-tracking branch 'upstream/main' into feature/corepack
This commit is contained in:
13
src/main.ts
13
src/main.ts
@@ -1,6 +1,5 @@
|
||||
import * as core from '@actions/core';
|
||||
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
|
||||
import * as auth from './authutil';
|
||||
@@ -9,7 +8,7 @@ import {restoreCache} from './cache-restore';
|
||||
import {isCacheFeatureAvailable} from './cache-utils';
|
||||
import {getNodejsDistribution} from './distributions/installer-factory';
|
||||
import {
|
||||
parseNodeVersionFile,
|
||||
getNodeVersionFromFile,
|
||||
printEnvDetailsAndSetOutput,
|
||||
enableCorepack
|
||||
} from './util';
|
||||
@@ -106,15 +105,7 @@ function resolveVersionInput(): string {
|
||||
versionFileInput
|
||||
);
|
||||
|
||||
if (!fs.existsSync(versionFilePath)) {
|
||||
throw new Error(
|
||||
`The specified node version file at: ${versionFilePath} does not exist`
|
||||
);
|
||||
}
|
||||
|
||||
const parsedVersion = parseNodeVersionFile(
|
||||
fs.readFileSync(versionFilePath, 'utf8')
|
||||
);
|
||||
const parsedVersion = getNodeVersionFromFile(versionFilePath);
|
||||
|
||||
if (parsedVersion) {
|
||||
version = parsedVersion;
|
||||
|
||||
Reference in New Issue
Block a user