mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-25 12:53:06 +07:00
Format & build
This commit is contained in:
parent
d903b6184b
commit
67c4cb799b
13
dist/setup/index.js
vendored
13
dist/setup/index.js
vendored
@ -73086,15 +73086,12 @@ DotnetInstallDir.dirPath = process.env['DOTNET_INSTALL_DIR']
|
||||
? DotnetInstallDir.convertInstallPathToAbsolute(process.env['DOTNET_INSTALL_DIR'])
|
||||
: DotnetInstallDir.default[utils_1.PLATFORM];
|
||||
class DotnetCoreInstaller {
|
||||
constructor(version, quality, preferInstalled = false) {
|
||||
this.version = version;
|
||||
constructor(dotnetVersion, quality) {
|
||||
this.dotnetVersion = dotnetVersion;
|
||||
this.quality = quality;
|
||||
this.preferInstalled = preferInstalled;
|
||||
}
|
||||
installDotnet() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const versionResolver = new DotnetVersionResolver(this.version, this.preferInstalled);
|
||||
const dotnetVersion = yield versionResolver.createDotnetVersion();
|
||||
/**
|
||||
* Install dotnet runitme first in order to get
|
||||
* the latest stable version of dotnet CLI
|
||||
@ -73122,7 +73119,7 @@ class DotnetCoreInstaller {
|
||||
// Don't overwrite CLI because it should be already installed
|
||||
.useArguments(utils_1.IS_WINDOWS ? '-SkipNonVersionedFiles' : '--skip-non-versioned-files')
|
||||
// Use version provided by user
|
||||
.useVersion(dotnetVersion, this.quality)
|
||||
.useVersion(this.dotnetVersion, this.quality)
|
||||
.execute();
|
||||
if (dotnetInstallOutput.exitCode) {
|
||||
throw new Error(`Failed to install dotnet, exit code: ${dotnetInstallOutput.exitCode}. ${dotnetInstallOutput.stderr}`);
|
||||
@ -73247,9 +73244,11 @@ function run() {
|
||||
throw new Error(`Value '${quality}' is not supported for the 'dotnet-quality' option. Supported values are: daily, signed, validated, preview, ga.`);
|
||||
}
|
||||
let dotnetInstaller;
|
||||
let dotnetVersionResolver;
|
||||
const uniqueVersions = new Set(versions);
|
||||
for (const version of uniqueVersions) {
|
||||
dotnetInstaller = new installer_1.DotnetCoreInstaller(version, quality, preferInstalled);
|
||||
dotnetVersionResolver = new installer_1.DotnetVersionResolver(version, preferInstalled);
|
||||
dotnetInstaller = new installer_1.DotnetCoreInstaller(yield dotnetVersionResolver.createDotnetVersion(), quality);
|
||||
const installedVersion = yield dotnetInstaller.installDotnet();
|
||||
installedDotnetVersions.push(installedVersion);
|
||||
}
|
||||
|
@ -275,7 +275,7 @@ export class DotnetCoreInstaller {
|
||||
|
||||
constructor(
|
||||
private dotnetVersion: DotnetVersion,
|
||||
private quality: QualityOptions,
|
||||
private quality: QualityOptions
|
||||
) {}
|
||||
|
||||
public async installDotnet(): Promise<string | null> {
|
||||
|
@ -1,5 +1,9 @@
|
||||
import * as core from '@actions/core';
|
||||
import {DotnetCoreInstaller, DotnetInstallDir, DotnetVersionResolver} from './installer';
|
||||
import {
|
||||
DotnetCoreInstaller,
|
||||
DotnetInstallDir,
|
||||
DotnetVersionResolver
|
||||
} from './installer';
|
||||
import * as fs from 'fs';
|
||||
import path from 'path';
|
||||
import semver from 'semver';
|
||||
@ -72,10 +76,13 @@ export async function run() {
|
||||
|
||||
const uniqueVersions = new Set<string>(versions);
|
||||
for (const version of uniqueVersions) {
|
||||
dotnetVersionResolver = new DotnetVersionResolver(version, preferInstalled);
|
||||
dotnetVersionResolver = new DotnetVersionResolver(
|
||||
version,
|
||||
preferInstalled
|
||||
);
|
||||
dotnetInstaller = new DotnetCoreInstaller(
|
||||
await dotnetVersionResolver.createDotnetVersion(),
|
||||
quality,
|
||||
quality
|
||||
);
|
||||
const installedVersion = await dotnetInstaller.installDotnet();
|
||||
installedDotnetVersions.push(installedVersion);
|
||||
|
Loading…
Reference in New Issue
Block a user