From 67c4cb799b2940e0ce8962a9f1c103e75c0374f5 Mon Sep 17 00:00:00 2001 From: Nikolai Laevskii Date: Mon, 4 Sep 2023 06:14:01 +0200 Subject: [PATCH] Format & build --- dist/setup/index.js | 13 ++++++------- src/installer.ts | 2 +- src/setup-dotnet.ts | 13 ++++++++++--- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 015e4ca..b01f167 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -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); } diff --git a/src/installer.ts b/src/installer.ts index c46b9b9..b31ebd9 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -275,7 +275,7 @@ export class DotnetCoreInstaller { constructor( private dotnetVersion: DotnetVersion, - private quality: QualityOptions, + private quality: QualityOptions ) {} public async installDotnet(): Promise { diff --git a/src/setup-dotnet.ts b/src/setup-dotnet.ts index 3ade9d9..2b8c6a6 100644 --- a/src/setup-dotnet.ts +++ b/src/setup-dotnet.ts @@ -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(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);