mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-22 05:54:45 +00:00
Merge remote-tracking branch 'upstream/main' into feature/corepack
This commit is contained in:
commit
c871b9da45
10 changed files with 211 additions and 193 deletions
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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue